changeset 13262:b5ce1a0a3d6e

Work around a MacOS X 10.4 bug with openpty.
author Simon Josefsson <simon@josefsson.org>
date Sun, 25 Apr 2010 12:59:22 +0200
parents 279d5dca8f6a
children e7d114c00ff9
files ChangeLog doc/glibc-functions/openpty.texi tests/test-openpty.c
diffstat 3 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-25  Simon Josefsson  <simon@josefsson.org>
+            Bruno Haible  <bruno@clisp.org>
+
+	Work around a MacOS X 10.4 bug with openpty.
+	* doc/glibc-functions/openpty.texi: Mention the MacOS X 10.4 bug.
+	* tests/test-openpty.c (main): Close the master side explicitly.
+
 2010-04-25  Bruno Haible  <bruno@clisp.org>
 
 	strnlen: Fix a C++ test error on MacOS X and Solaris.
--- a/doc/glibc-functions/openpty.texi
+++ b/doc/glibc-functions/openpty.texi
@@ -30,4 +30,9 @@
 @item
 This function is missing on some platforms:
 mingw.
+@item
+After a successful call to @code{openpty}, the application needs to close
+the master's file descriptor before closing the slave's file descriptor,
+otherwise the process may hang in a state where it cannot be killed, on
+some platforms: MacOS X 10.4.11.
 @end itemize
--- a/tests/test-openpty.c
+++ b/tests/test-openpty.c
@@ -99,6 +99,10 @@
           return 1;
         }
     }
+
+    /* Close the master side before the slave side gets closed.
+       This is necessary on MacOS X 10.4.11.  */
+    close (master);
   }
 
   return 0;