The code includes "signal(SIGCHLD, SIG_IGN); " to prevent process from zombie.
So the wait() is unable to get the signal and system() will return -1.
Solution:
Change from SIG_IGN to SIG_DFL.
In my case, I have to retain signal(SIGCHLD, SIG_IGN), so how to handle well with its return value?
2011年4月12日
system() return (10): No child processes
標籤: Programming
訂閱:
張貼留言 (Atom)
2 意見:
張貼留言