ruby-changes:28876
From: naruse <ko1@a...>
Date: Sat, 25 May 2013 21:35:56 +0900 (JST)
Subject: [ruby-changes:28876] naruse:r40928 (trunk): * ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stable
naruse 2013-05-25 21:34:50 +0900 (Sat, 25 May 2013) New Revision: 40928 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40928 Log: * ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stable added O_CLOEXEC support to posix_openpt, so assume FreeBSD 9.2 or later supports it. http://www.freebsd.org/cgi/query-pr.cgi?pr=162374 Modified files: trunk/ChangeLog trunk/ext/pty/pty.c Index: ChangeLog =================================================================== --- ChangeLog (revision 40927) +++ ChangeLog (revision 40928) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat May 25 21:29:34 2013 NARUSE, Yui <naruse@r...> + + * ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stable + added O_CLOEXEC support to posix_openpt, so assume FreeBSD 9.2 or + later supports it. + http://www.freebsd.org/cgi/query-pr.cgi?pr=162374 + Sat May 25 18:46:23 2013 Yusuke Endoh <mame@t...> * proc.c (rb_method_entry_min_max_arity): fix missing break in switch. Index: ext/pty/pty.c =================================================================== --- ext/pty/pty.c (revision 40927) +++ ext/pty/pty.c (revision 40928) @@ -22,6 +22,10 @@ https://github.com/ruby/ruby/blob/trunk/ext/pty/pty.c#L22 #ifdef HAVE_PTY_H #include <pty.h> #endif +#if defined(HAVE_SYS_PARAM_H) + /* for __FreeBSD_version */ +# include <sys/param.h> +#endif #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> #else @@ -228,9 +232,9 @@ get_device_once(int *master, int *slave, https://github.com/ruby/ruby/blob/trunk/ext/pty/pty.c#L232 dfl.sa_flags = 0; sigemptyset(&dfl.sa_mask); -#if defined(__sun) || defined(__FreeBSD__) +#if defined(__sun) || (defined(__FreeBSD__) && __FreeBSD_version < 902000) /* workaround for Solaris 10: grantpt() doesn't work if FD_CLOEXEC is set. [ruby-dev:44688] */ - /* FreeBSD 8 supported O_CLOEXEC for posix_openpt, but FreeBSD 9 removed it. + /* FreeBSD 9.2 or later supports O_CLOEXEC * http://www.freebsd.org/cgi/query-pr.cgi?pr=162374 */ if ((masterfd = posix_openpt(O_RDWR|O_NOCTTY)) == -1) goto error; if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/