#21 Incorrect exit status for child process is returned by basic_pstreambuf::status()

xyzzy
wont-fix
nobody
None
5
2014-04-13
2014-04-08
Artem
No

This is because the status returned by waitpid is not the same as the exit status of the child process (but rather an encoding of it). Consequently, WEXITSTATUS should be used to get the actual value in basic_pstreambuf::wait(), as long as the process terminated normally.

http://stackoverflow.com/a/3659648

Discussion

  • This is by design, so users can use WIFEXITED, WIFSIGNALLED etc.

    (See the examples in test_pstreams.cc that do exactly that.)

     
    Last edit: Jonathan Wakely 2014-04-13
    • status: open --> wont-fix