U
unknown
Hi,
I have an application featuring a verbose mode and a daemon mode.
It's working just fine in verbose mode but in daemon mode it doesn't quite
seem to be functioning properly,
I get into Daemon mode with a fork command followed by exit() to be
specific, it looks like:
[C++]
pid = fork();
if (pid < 0)
{
exit(EXIT_FAILURE);
}
else if (pid > 0)
{
exit(EXIT_SUCCESS);
}
umask(0);
sid = setsid();
[/C++]
Is there a problem with this? Do I miss anything?
Thanks,
Ron
I have an application featuring a verbose mode and a daemon mode.
It's working just fine in verbose mode but in daemon mode it doesn't quite
seem to be functioning properly,
I get into Daemon mode with a fork command followed by exit() to be
specific, it looks like:
[C++]
pid = fork();
if (pid < 0)
{
exit(EXIT_FAILURE);
}
else if (pid > 0)
{
exit(EXIT_SUCCESS);
}
umask(0);
sid = setsid();
[/C++]
Is there a problem with this? Do I miss anything?
Thanks,
Ron