diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-11-22 15:29:14 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-11-22 15:29:14 -0500 |
commit | d8f1908b821098f7a2ff03fbf6b152fe13023057 (patch) | |
tree | f792a251a087b299aaa32d10a99333fc49918d5c /src/signal/x86_64 | |
parent | a516077feba96ec24d1ca8a9cbb8490bfdd066f1 (diff) | |
download | musl-d8f1908b821098f7a2ff03fbf6b152fe13023057.tar.gz musl-d8f1908b821098f7a2ff03fbf6b152fe13023057.tar.xz musl-d8f1908b821098f7a2ff03fbf6b152fe13023057.zip |
improve robustness of wordexp and fix handling of 0-word case
avoid using exit status to determine if a shell error occurred, since broken programs may install SIGCHLD handlers which reap all zombies, including ones that don't belong to them. using clone and __WCLONE does not seem to work for avoiding this problem since exec resets the exit signal to SIGCHLD. instead, the new code uses a dummy word at the beginning of the shell's output, which is ignored, to determine whether the command was executed successfully. this also fixes a corner case where a word string containing zero words was interpreted as a single zero-length word rather than no words at all. POSIX does not seem to require this case to be supported anyway, though. in addition, the new code uses the correct retry idiom for waitpid to ensure that spurious STOP/CONT signals in the child and/or EINTR in the parent do not prevent successful wait for the child, and blocks signals in the child.
Diffstat (limited to 'src/signal/x86_64')
0 files changed, 0 insertions, 0 deletions