#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

  • Jonathan Wakely

    Jonathan Wakely - 2014-04-13

    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
  • Jonathan Wakely

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

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks