I'm trying to port an application from OpenVMS to Linux. The application creates subprocesses in the following way:
if ((pid = fork()) == 0)
{
// do subprocess
}
else if (pid < 0)
{
printf("\ncreation of subprocess failed") ;
}
else
{
wait(pid) ;
}
Now the compiler (gcc) gives me a warning that the case 'pid < 0' will never be reached. But why, and how can I then catch problems in fork()?
Thanks a lot in advance for your help
Jörg