<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
Attempting to correct the problem about which I earlier posted - wherein
a system() call which apparently succeeds is perceived to have failed by
the * process, I changed code in app_system.c so that it would be more discerning...<br>
<br>
<small><font face="Courier New, Courier, monospace"> res = system((char
*)data);<br>
/*<br>
if (res < 0) {<br>
ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char *)data);<br>
res = -1;<br>
} else if (res == 127) {<br>
ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char *)data);<br>
res = -1;<br>
*/<br>
if (res == -1) {<br>
ast_log(LOG_WARNING, "Fork failed for '%s'\n", (char *)data);<br>
res = -1;<br>
} else if (WEXITSTATUS(res) != 0) {<br>
ast_log(LOG_WARNING, "Error completion for '%s'\n", (char
*)data);<br>
res = -1;<br>
</font></small> <br>
It is now indeed more discerning, but it has reported Fork failed. But the
fork most certainly has not failed! The shell command invoked has run, and
what's more, completed successfully, producing the expected files.<br>
<br>
Referring to the system(2) man page (Red Hat 9, stock)...<br>
<br>
<small><font face="Courier New, Courier, monospace">RETURN VALUE<br>
The value returned is -1 on error (e.g. fork failed), and the return<br>
status of the command otherwise. This latter return status is in
the<br>
format specified in wait(2). Thus, the exit code of the command
will<br>
be WEXITSTATUS(status). In case /bin/sh could not be executed,
the<br>
exit status will be that of a command that does exit(127).<br>
</font></small><br>
...and noting that "fork failed" is only an example of an error, I'm wondering
what *other* condition might cause the -1 return value.<br>
<br>
Does anyone have any ideas?<br>
<br>
</body>
</html>