* io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),
but its return value is -1 or larger than 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a16c2745fe
commit
ca6311b0b5
@ -1,3 +1,8 @@
|
||||
Mon Oct 31 21:47:44 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),
|
||||
but its return value is -1 or larger than 0.
|
||||
|
||||
Mon Oct 31 22:04:54 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/dbm/dbm.c (fdbm_initialize): use O_CLOEXEC if available.
|
||||
|
6
io.c
6
io.c
@ -253,8 +253,14 @@ rb_cloexec_pipe(int fildes[2])
|
||||
static int try_pipe2 = 1;
|
||||
if (try_pipe2) {
|
||||
ret = pipe2(fildes, O_CLOEXEC);
|
||||
#ifdef defined(__NetBSD__)
|
||||
/* pipe2 is available since NetBSD 6.0. */
|
||||
if (ret > 0)
|
||||
return 0;
|
||||
#else
|
||||
if (ret != -1)
|
||||
return ret;
|
||||
#endif
|
||||
/* pipe2 is available since Linux 2.6.27. */
|
||||
if (errno == ENOSYS) {
|
||||
try_pipe2 = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user