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:
parent
44a522c6a4
commit
b00710df4e
2 changed files with 7 additions and 9 deletions
|
@ -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>
|
Thu Sep 4 00:01:45 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
|
* test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ruby/ruby.h"
|
#include "ruby/ruby.h"
|
||||||
#include "ruby/signal.h"
|
|
||||||
#include "dln.h"
|
#include "dln.h"
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <process.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)
|
#define rb_w32_open_osfhandle(osfhandle, flags) _open_osfhandle(osfhandle, flags)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define RUBY_CRITICAL(expr) do { expr; } while (0)
|
||||||
|
|
||||||
/* errno mapping */
|
/* errno mapping */
|
||||||
static struct {
|
static struct {
|
||||||
DWORD winerr;
|
DWORD winerr;
|
||||||
|
@ -3766,13 +3767,11 @@ catch_interrupt(void)
|
||||||
int
|
int
|
||||||
read(int fd, void *buf, size_t size)
|
read(int fd, void *buf, size_t size)
|
||||||
{
|
{
|
||||||
int trap_immediate = rb_trap_immediate;
|
|
||||||
int ret = _read(fd, buf, size);
|
int ret = _read(fd, buf, size);
|
||||||
if ((ret < 0) && (errno == EPIPE)) {
|
if ((ret < 0) && (errno == EPIPE)) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
rb_trap_immediate = trap_immediate;
|
|
||||||
catch_interrupt();
|
catch_interrupt();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3782,11 +3781,10 @@ read(int fd, void *buf, size_t size)
|
||||||
int
|
int
|
||||||
rb_w32_getc(FILE* stream)
|
rb_w32_getc(FILE* stream)
|
||||||
{
|
{
|
||||||
int c, trap_immediate = rb_trap_immediate;
|
int c;
|
||||||
#ifndef _WIN32_WCE
|
#ifndef _WIN32_WCE
|
||||||
if (enough_to_get(stream->FILE_COUNT)) {
|
if (enough_to_get(stream->FILE_COUNT)) {
|
||||||
c = (unsigned char)*stream->FILE_READPTR++;
|
c = (unsigned char)*stream->FILE_READPTR++;
|
||||||
rb_trap_immediate = trap_immediate;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -3797,7 +3795,6 @@ rb_w32_getc(FILE* stream)
|
||||||
clearerr(stream);
|
clearerr(stream);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
rb_trap_immediate = trap_immediate;
|
|
||||||
catch_interrupt();
|
catch_interrupt();
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
|
@ -3807,17 +3804,14 @@ rb_w32_getc(FILE* stream)
|
||||||
int
|
int
|
||||||
rb_w32_putc(int c, FILE* stream)
|
rb_w32_putc(int c, FILE* stream)
|
||||||
{
|
{
|
||||||
int trap_immediate = rb_trap_immediate;
|
|
||||||
#ifndef _WIN32_WCE
|
#ifndef _WIN32_WCE
|
||||||
if (enough_to_put(stream->FILE_COUNT)) {
|
if (enough_to_put(stream->FILE_COUNT)) {
|
||||||
c = (unsigned char)(*stream->FILE_READPTR++ = (char)c);
|
c = (unsigned char)(*stream->FILE_READPTR++ = (char)c);
|
||||||
rb_trap_immediate = trap_immediate;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
c = _flsbuf(c, stream);
|
c = _flsbuf(c, stream);
|
||||||
rb_trap_immediate = trap_immediate;
|
|
||||||
catch_interrupt();
|
catch_interrupt();
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
|
|
Loading…
Add table
Reference in a new issue