1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* win32/win32.c: fix ruby/signal.h depending codes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2008-09-03 15:06:55 +00:00
parent 44a522c6a4
commit b00710df4e
2 changed files with 7 additions and 9 deletions

View file

@ -1,3 +1,7 @@
Thu Sep 4 00:04:59 2008 Koichi Sasada <ko1@atdot.net>
* win32/win32.c: fix ruby/signal.h depending codes.
Thu Sep 4 00:01:45 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use

View file

@ -11,7 +11,6 @@
*/
#include "ruby/ruby.h"
#include "ruby/signal.h"
#include "dln.h"
#include <fcntl.h>
#include <process.h>
@ -74,6 +73,8 @@ static int rb_w32_open_osfhandle(intptr_t osfhandle, int flags);
#define rb_w32_open_osfhandle(osfhandle, flags) _open_osfhandle(osfhandle, flags)
#endif
#define RUBY_CRITICAL(expr) do { expr; } while (0)
/* errno mapping */
static struct {
DWORD winerr;
@ -3766,13 +3767,11 @@ catch_interrupt(void)
int
read(int fd, void *buf, size_t size)
{
int trap_immediate = rb_trap_immediate;
int ret = _read(fd, buf, size);
if ((ret < 0) && (errno == EPIPE)) {
errno = 0;
ret = 0;
}
rb_trap_immediate = trap_immediate;
catch_interrupt();
return ret;
}
@ -3782,11 +3781,10 @@ read(int fd, void *buf, size_t size)
int
rb_w32_getc(FILE* stream)
{
int c, trap_immediate = rb_trap_immediate;
int c;
#ifndef _WIN32_WCE
if (enough_to_get(stream->FILE_COUNT)) {
c = (unsigned char)*stream->FILE_READPTR++;
rb_trap_immediate = trap_immediate;
}
else
#endif
@ -3797,7 +3795,6 @@ rb_w32_getc(FILE* stream)
clearerr(stream);
}
#endif
rb_trap_immediate = trap_immediate;
catch_interrupt();
}
return c;
@ -3807,17 +3804,14 @@ rb_w32_getc(FILE* stream)
int
rb_w32_putc(int c, FILE* stream)
{
int trap_immediate = rb_trap_immediate;
#ifndef _WIN32_WCE
if (enough_to_put(stream->FILE_COUNT)) {
c = (unsigned char)(*stream->FILE_READPTR++ = (char)c);
rb_trap_immediate = trap_immediate;
}
else
#endif
{
c = _flsbuf(c, stream);
rb_trap_immediate = trap_immediate;
catch_interrupt();
}
return c;