From: nobu@... Date: 2007-04-03T19:26:15+09:00 Subject: [ruby-dev:30679] IO.popen doesn't fail for non-existent command なかだです。 http://bts.vinelinux.org/guest.cgi?project=VineLinux&action=view_report&id=481 「481: ri で command not found: pager」に関連した話ですが、 IO.popenに存在しないコマンドを指定したときにエラーにならないの は、少なくとも1.9でバグだと思います。 * io.c (popen_exec): should not close close-on-exec fds. Index: io.c =================================================================== --- io.c (revision 12141) +++ io.c (working copy) @@ -3041,4 +3041,7 @@ popen_exec(void *pp) popen_redirect(p); for (fd = 3; fd < NOFILE; fd++) { +#ifdef FD_CLOEXEC + if (fcntl(fd, F_GETFD) & FD_CLOEXEC) continue; +#endif close(fd); } -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦