daemonizing not quite working :o


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 (doesn't send off signalss over TCP/IP or write anything to the GPIOs - that's why i belive exit() is terminating "too much"), 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); }


sid = setsid(); [/C++] Is there a problem with this? Do I miss anything? Thanks, Ron

weeks of software enineering safe hours of planing ;)
Reply to
Ron Eggler
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.