diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-31 13:21:03 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-31 13:21:03 +0000 |
commit | ca6311b0b50341f55993e47f2323af55be4d0ebb (patch) | |
tree | 2ac307ededdd4ea17089d13abc9103b400318141 /io.c | |
parent | a16c2745fe843d41bf2046e8362e6963c604e5a8 (diff) | |
download | ruby-ca6311b0b50341f55993e47f2323af55be4d0ebb.tar.gz |
* 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
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |