tracing the error code returned by wait call
hi all,
i am calling an exe using execl function using fork system call.
wait call is used to exit the child process.
if there is any error occures wait will return the exit state respective to the error no or exit code.
i am handling errors using WIFEXITED and WEXITSTATUS
if(WIFEXITED(child_status))
{
switch(WEXITSTATUS(child_status))
{
case EXIT_ERR_CODES:
fprintf(log,"%s:localfile error\n",ctime(&t));
break;
}
}
problem is wait returning the exit code but the log is not creting for respective error code.
what could be the problem?
thanx in advance,
g3.
|