ruby-changes:4695
From: ko1@a...
Date: Fri, 25 Apr 2008 10:55:46 +0900 (JST)
Subject: [ruby-changes:4695] usa - Ruby:r16189 (trunk): * include/ruby/win32.h: define mode_t for umask.
usa 2008-04-25 10:55:22 +0900 (Fri, 25 Apr 2008) New Revision: 16189 Modified files: trunk/ChangeLog trunk/include/ruby/win32.h trunk/process.c Log: * include/ruby/win32.h: define mode_t for umask. * process.c (check_exec_options_i, check_exec_fds, run_exec_options): support "close_others" only when fork(2) is available. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/win32.h?r1=16189&r2=16188&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16189&r2=16188&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/process.c?r1=16189&r2=16188&diff_format=u Index: include/ruby/win32.h =================================================================== --- include/ruby/win32.h (revision 16188) +++ include/ruby/win32.h (revision 16189) @@ -89,6 +89,9 @@ # define _UINTPTR_T_DEFINED # endif #endif +#ifndef __MINGW32__ +# define mode_t int +#endif #ifdef _M_IX86 # define WIN95 1 Index: ChangeLog =================================================================== --- ChangeLog (revision 16188) +++ ChangeLog (revision 16189) @@ -1,3 +1,10 @@ +Fri Apr 25 10:52:27 2008 NAKAMURA Usaku <usa@r...> + + * include/ruby/win32.h: define mode_t for umask. + + * process.c (check_exec_options_i, check_exec_fds, run_exec_options): + support "close_others" only when fork(2) is available. + Fri Apr 25 00:16:11 2008 Tanaka Akira <akr@f...> * process.c: include sys/stat.h for umask. Index: process.c =================================================================== --- process.c (revision 16188) +++ process.c (revision 16189) @@ -1434,6 +1434,7 @@ } rb_ary_store(options, EXEC_OPTION_UMASK, LONG2NUM(cmask)); } +#ifdef HAVE_FORK else if (id == rb_intern("close_others")) { if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_CLOSE_OTHERS))) { rb_raise(rb_eArgError, "close_others option specified twice"); @@ -1441,6 +1442,7 @@ val = RTEST(val) ? Qtrue : Qfalse; rb_ary_store(options, EXEC_OPTION_CLOSE_OTHERS, val); } +#endif else if (id == rb_intern("in")) { key = INT2FIX(0); goto redirect; @@ -1501,9 +1503,11 @@ } } } +#ifdef HAVE_FORK if (RTEST(rb_ary_entry(options, EXEC_OPTION_CLOSE_OTHERS))) { rb_ary_store(options, EXEC_OPTION_CLOSE_OTHERS, INT2FIX(maxhint)); } +#endif return h; } @@ -1843,6 +1847,7 @@ if (pairs[i].oldfd == -1) continue; if (pairs[i].oldfd == pairs[i].newfd) { /* self cycle */ +#ifdef F_GETFD int fd = pairs[i].oldfd; ret = fcntl(fd, F_GETFD); if (ret == -1) @@ -1853,6 +1858,7 @@ if (ret == -1) goto fail; } +#endif pairs[i].oldfd = -1; continue; } @@ -2045,10 +2051,12 @@ return -1; } +#ifdef HAVE_FORK obj = rb_ary_entry(options, EXEC_OPTION_CLOSE_OTHERS); if (RTEST(obj)) { rb_close_before_exec(3, FIX2INT(obj), e->redirect_fds); } +#endif obj = rb_ary_entry(options, EXEC_OPTION_OPEN); if (!NIL_P(obj)) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/