ruby-changes:21616
From: naruse <ko1@a...>
Date: Tue, 8 Nov 2011 11:04:10 +0900 (JST)
Subject: [ruby-changes:21616] naruse:r33665 (trunk): * ext/pty/pty.c (get_device_once): FreeBSD's posix_openpt doesn't
naruse 2011-11-08 11:03:57 +0900 (Tue, 08 Nov 2011) New Revision: 33665 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33665 Log: * ext/pty/pty.c (get_device_once): FreeBSD's posix_openpt doesn't support O_CLOEXEC and fails if specified. Modified files: trunk/ChangeLog trunk/ext/pty/pty.c Index: ChangeLog =================================================================== --- ChangeLog (revision 33664) +++ ChangeLog (revision 33665) @@ -1,3 +1,8 @@ +Tue Nov 8 11:01:04 2011 NARUSE, Yui <naruse@r...> + + * ext/pty/pty.c (get_device_once): FreeBSD's posix_openpt doesn't + support O_CLOEXEC and fails if specified. + Mon Nov 7 22:03:47 2011 Tanaka Akira <akr@f...> * ext/gdbm/gdbm.c (fgdbm_initialize): set close-on-exec flag. Index: ext/pty/pty.c =================================================================== --- ext/pty/pty.c (revision 33664) +++ ext/pty/pty.c (revision 33665) @@ -299,10 +299,11 @@ rb_fd_fix_cloexec(masterfd); #else flags = O_RDWR|O_NOCTTY; -# ifdef O_CLOEXEC +# if defined(O_CLOEXEC) && !defined(__FreeBSD__) /* glibc posix_openpt() in GNU/Linux calls open("/dev/ptmx", flags) internally. * So version dependency on GNU/Linux is same as O_CLOEXEC with open(). - * O_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */ + * O_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. + * FreeBSD's posix_openpt doesn't support O_CLOEXEC and fails if specified*/ flags |= O_CLOEXEC; # endif if ((masterfd = posix_openpt(flags)) == -1) goto error; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/