emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113964: Port close-on-exec pty creation to FreeBSD


From: Paul Eggert
Subject: [Emacs-diffs] trunk r113964: Port close-on-exec pty creation to FreeBSD 9.1-RELEASE.
Date: Wed, 21 Aug 2013 06:11:55 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113964
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15129
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2013-08-20 23:11:50 -0700
message:
  Port close-on-exec pty creation to FreeBSD 9.1-RELEASE.
  
  * configure.ac (PTY_OPEN): If posix_openpt with O_CLOEXEC fails
  and reports EINVAL, try it again without O_CLOEXEC.  This should
  port PTY_OPEN to FreeBSD 9, which stupidly rejects O_CLOEXEC.
  What were they thinking?
modified:
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  configure.ac                   
configure.in-20091113204419-o5vbwnq5f7feedwu-783
=== modified file 'ChangeLog'
--- a/ChangeLog 2013-08-20 08:30:24 +0000
+++ b/ChangeLog 2013-08-21 06:11:50 +0000
@@ -1,3 +1,11 @@
+2013-08-21  Paul Eggert  <address@hidden>
+
+       Port close-on-exec pty creation to FreeBSD 9.1-RELEASE (Bug#15129).
+       * configure.ac (PTY_OPEN): If posix_openpt with O_CLOEXEC fails
+       and reports EINVAL, try it again without O_CLOEXEC.  This should
+       port PTY_OPEN to FreeBSD 9, which stupidly rejects O_CLOEXEC.
+       What were they thinking?
+
 2013-08-20  Paul Eggert  <address@hidden>
 
        * Makefile.in (distclean, bootstrap-clean, maintainer-clean):

=== modified file 'configure.ac'
--- a/configure.ac      2013-08-15 16:37:15 +0000
+++ b/configure.ac      2013-08-21 06:11:50 +0000
@@ -3994,7 +3994,7 @@
       AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname = 0; sigset_t blocked; 
sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask 
(SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) 
ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if 
(!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, 
"%s", ptyname); }])
       dnl if HAVE_POSIX_OPENPT
       if test "x$ac_cv_func_posix_openpt" = xyes; then
-        AC_DEFINE(PTY_OPEN, [fd = posix_openpt (O_RDWR | O_CLOEXEC | 
O_NOCTTY)])
+        AC_DEFINE(PTY_OPEN, [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | 
O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | 
O_NOCTTY); } while (0)])
         AC_DEFINE(PTY_NAME_SPRINTF, [])
       dnl if HAVE_GETPT
       elif test "x$ac_cv_func_getpt" = xyes; then


reply via email to

[Prev in Thread] Current Thread [Next in Thread]