typedef void (*sighandler_t)(int);
int jh_system(const char *cmd_line)
{
int ret = 0;
sighandler_t old_handler;
old_handler = signal(SIGCHLD, SIG_DFL);
ret = system(cmd_line);
signal(SIGCHLD, old_handler);
return ret;
}
or
if
(
signal
(SIGCHLD, SIG_IGN) == SIG_ERR) {
return
-1;
}
else
{
return
0;
}
or
pOPEN