# HG changeset patch # User Simon Josefsson # Date 1272193162 -7200 # Node ID b5ce1a0a3d6e7bb8dbfa333c844d21a38fc77057 # Parent 279d5dca8f6a88091a1ce7cbc96ad06a13cb1d8a Work around a MacOS X 10.4 bug with openpty. diff --git a/ChangeLog b/ChangeLog --- 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 --- 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 diff --git a/tests/test-openpty.c b/tests/test-openpty.c --- 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;