aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-11 02:29:00 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-11 02:29:00 +0000
commite4ac591a209890cc9e9d1a9333a4e0ec9c77c901 (patch)
tree8f19bb1fefeb6f0c4249e834bfdcc895d7edc79c /io.c
parent1a14a7a1d78092161cd296d0aa14b7a17ce46edd (diff)
downloadruby-e4ac591a209890cc9e9d1a9333a4e0ec9c77c901.tar.gz
* io.c: fix issues in the last two commits. don't disable cloexec for
platforms other than NativeClient. * ChangeLog: ditto. add entries for the last two commits. Sat Oct 11 11:12:00 2014 Yuki Yugui Sonoda <yugui@yugui.jp> * signal.c (install_signalhandler, init_sigchld): allow failure because it always fails with ENOSYS on NaCl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/io.c b/io.c
index 4f98031c40..61c87206d9 100644
--- a/io.c
+++ b/io.c
@@ -126,6 +126,10 @@
off_t __syscall(quad_t number, ...);
#endif
+#ifdef __native_client__
+# undef F_GETFD
+#endif
+
#define IO_RBUF_CAPA_MIN 8192
#define IO_CBUF_CAPA_MIN (128*1024)
#define IO_RBUF_CAPA_FOR(fptr) (NEED_READCONV(fptr) ? IO_CBUF_CAPA_MIN : IO_RBUF_CAPA_MIN)
@@ -204,9 +208,6 @@ rb_update_max_fd(int fd)
}
}
-#undef HAVE_FCNTL
-#undef O_CLOEXEC
-
void
rb_maygvl_fd_fix_cloexec(int fd)
{
@@ -241,7 +242,7 @@ rb_fd_fix_cloexec(int fd)
static int
rb_fix_detect_o_cloexec(int fd)
{
-#ifdef O_CLOEXEC
+#if defined(O_CLOEXEC) && defined(F_GETFD)
int flags = fcntl(fd, F_GETFD);
if (flags == -1)