From: Simon Josefsson Date: Sun, 25 Apr 2010 10:59:22 +0000 (+0200) Subject: Work around a MacOS X 10.4 bug with openpty. X-Git-Tag: v0.1~4225 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=ff78f3d64436099230e35fc7e7f7a54ad967fa83;p=gnulib.git Work around a MacOS X 10.4 bug with openpty. --- diff --git a/ChangeLog b/ChangeLog index b115acd43..3b85b0263 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-04-25 Simon Josefsson + Bruno Haible + + 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 strnlen: Fix a C++ test error on MacOS X and Solaris. diff --git a/doc/glibc-functions/openpty.texi b/doc/glibc-functions/openpty.texi index 31fdca009..b9577d599 100644 --- a/doc/glibc-functions/openpty.texi +++ b/doc/glibc-functions/openpty.texi @@ -30,4 +30,9 @@ Portability problems not fixed by Gnulib: @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 diff --git a/tests/test-openpty.c b/tests/test-openpty.c index 4012e160f..41caaf259 100644 --- a/tests/test-openpty.c +++ b/tests/test-openpty.c @@ -99,6 +99,10 @@ main () 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;