+2013-01-21 Andreas Schwab <schwab@suse.de>
+
+ [BZ #15020]
+ * posix/wordexp.c (exec_comm): Avoid busy loop when command has
+ closed its stdout.
+
2013-01-20 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/powerpc/powerpc32/power4/fpu/mpa.c: Don't include
* The following bugs are resolved with this release:
13951, 14200, 14317, 14327, 14496, 14964, 14981, 14982, 14985, 14994,
- 14996, 15003, 15023.
+ 14996, 15003, 15020, 15023.
\f
Version 2.17
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)
{
- if (TEMP_FAILURE_RETRY (__waitpid (pid, &status, WNOHANG)) == 0)
+ /* If read returned 0 then the process has closed its
+ stdout. Don't use WNOHANG in that case to avoid busy
+ looping until the process eventually exits. */
+ if (TEMP_FAILURE_RETRY (__waitpid (pid, &status,
+ buflen == 0 ? 0 : WNOHANG))
+ == 0)
continue;
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)
{
- if (TEMP_FAILURE_RETRY (__waitpid (pid, &status, WNOHANG)) == 0)
+ /* If read returned 0 then the process has closed its
+ stdout. Don't use WNOHANG in that case to avoid busy
+ looping until the process eventually exits. */
+ if (TEMP_FAILURE_RETRY (__waitpid (pid, &status,
+ buflen == 0 ? 0 : WNOHANG))
+ == 0)
continue;
if ((buflen = TEMP_FAILURE_RETRY (__read (fildes[0], buffer,
bufsize))) < 1)