aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-08-21 07:51:39 +0200
committerJoakim Verona2013-08-21 07:51:39 +0200
commit5092c2e28a39e6fdf63cad5d9c59a53687ea807e (patch)
tree849cc6ef3e531cad3cff60e12de4913b9587e9fe
parent43ee61f2e70c79ab2ac51893890614f0c8874e2f (diff)
parent0d7c1e66ffad14f76fbd226d50113a61c738806c (diff)
downloademacs-5092c2e28a39e6fdf63cad5d9c59a53687ea807e.tar.gz
emacs-5092c2e28a39e6fdf63cad5d9c59a53687ea807e.zip
merge from trunk
-rw-r--r--src/ChangeLog6
-rw-r--r--src/process.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 997459f01c2..c7cceb27a4f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12013-08-21 Paul Eggert <eggert@cs.ucla.edu>
2
3 * process.c (allocate_pty) [PTY_OPEN]: Set fd's FD_CLOEXEC flag.
4 We can't portably rely on PTY_OPEN doing that, even if
5 it calls posix_openpt with O_CLOEXEC.
6
12013-08-20 Kenichi Handa <handa@gnu.org> 72013-08-20 Kenichi Handa <handa@gnu.org>
2 8
3 * character.c (string_char): Improve commentary. 9 * character.c (string_char): Improve commentary.
diff --git a/src/process.c b/src/process.c
index c4dd87a6b48..349ec26534b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -687,6 +687,15 @@ allocate_pty (char pty_name[PTY_NAME_SIZE])
687 687
688 if (fd >= 0) 688 if (fd >= 0)
689 { 689 {
690#ifdef PTY_OPEN
691 /* Set FD's close-on-exec flag. This is needed even if
692 PT_OPEN calls posix_openpt with O_CLOEXEC, since POSIX
693 doesn't require support for that combination.
694 Multithreaded platforms where posix_openpt ignores
695 O_CLOEXEC (or where PTY_OPEN doesn't call posix_openpt)
696 have a race condition between the PTY_OPEN and here. */
697 fcntl (fd, F_SETFD, FD_CLOEXEC);
698#endif
690 /* check to make certain that both sides are available 699 /* check to make certain that both sides are available
691 this avoids a nasty yet stupid bug in rlogins */ 700 this avoids a nasty yet stupid bug in rlogins */
692#ifdef PTY_TTY_NAME_SPRINTF 701#ifdef PTY_TTY_NAME_SPRINTF