* io.c (pipe_open): errno should be preserved for rb_sys_fail() when
fork failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6e84eab64
commit
6f1b13de99
@ -1,3 +1,8 @@
|
||||
Tue Nov 30 23:49:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (pipe_open): errno should be preserved for rb_sys_fail() when
|
||||
fork failed.
|
||||
|
||||
Tue Nov 30 16:18:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (io_fread): need not to null terminate. [ruby-dev:24998]
|
||||
|
2
io.c
2
io.c
@ -2903,8 +2903,10 @@ pipe_open(argc, argv, mode)
|
||||
if (modef & FMODE_READABLE) close(arg.pr[1]);
|
||||
if (modef & FMODE_WRITABLE) close(arg.pw[0]);
|
||||
if (pid == -1) {
|
||||
int e = errno;
|
||||
if (modef & FMODE_READABLE) close(arg.pr[0]);
|
||||
if (modef & FMODE_WRITABLE) close(arg.pw[1]);
|
||||
errno = e;
|
||||
rb_sys_fail(cmd);
|
||||
}
|
||||
#define PIPE_FDOPEN(i) (rb_fdopen((i?arg.pw:arg.pr)[i], i?"w":"r"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user