I get wrong exit code from waitpid and I can't figure out why. Could someone give me some ideas?
Here what I do:
- I start my child process with
open2
- then I wait for it to finish with
waitpid
- get exit code using
$?
It always returns with -1 no mater what I return from child process. I check with VS debugger that my program returns an exit code of 0. VS says something like this:
The program '[3256] Test.exe: Native' has exited with code 0 (0x0).
I made sure that pids match.
Any ideas?