diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 04:33:22 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 04:33:22 +0000 |
| commit | bd7bce0bca656546d97ecf7bbbe9ad101822eb7b (patch) | |
| tree | f9ffb615a7d4b8ddf5afd2d0c8f83971eaa8389b | |
| parent | 4be84ede7ca146167f59346780ee76f6d7d2d48c (diff) | |
| download | ruby-bd7bce0bca656546d97ecf7bbbe9ad101822eb7b.tar.gz ruby-bd7bce0bca656546d97ecf7bbbe9ad101822eb7b.tar.xz ruby-bd7bce0bca656546d97ecf7bbbe9ad101822eb7b.zip | |
* io.c: sorry, wrong commit. orz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | io.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -4419,9 +4419,7 @@ popen_redirect(struct popen_arg *p) } } } -#endif -#if defined(HAVE_FORK) || defined(_WIN32) void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds) { @@ -4438,16 +4436,12 @@ rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds) if (ret != -1 && !(ret & FD_CLOEXEC)) { fcntl(fd, F_SETFD, ret|FD_CLOEXEC); } -#elif defined(_WIN32) - rb_w32_fd_noinherit(fd); #else close(fd); #endif } } -#endif -#ifdef HAVE_FORK static int popen_exec(void *pp, char *errmsg, size_t errmsg_len) { @@ -5931,15 +5925,13 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io) fd = NUM2INT(fnum); UPDATE_MAXFD(fd); -#if defined(HAVE_FCNTL) && defined(F_GETFL) if (NIL_P(vmode)) { +#if defined(HAVE_FCNTL) && defined(F_GETFL) oflags = fcntl(fd, F_GETFL); if (oflags == -1) rb_sys_fail(0); fmode = rb_io_oflags_fmode(oflags); - } -#elif defined(_WIN32) - if (rb_w32_is_valid_fd(fd)) rb_sys_fail(0); #endif + } MakeOpenFile(io, fp); fp->fd = fd; fp->mode = fmode; |
