From 955aeb64b7b504a4d1b652274affcfacf3d581aa Mon Sep 17 00:00:00 2001 From: Sergey Popov Date: Tue, 20 Dec 2011 18:01:46 +0400 Subject: [PATCH] remove unneeded fork(for now) --- yasnd.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/yasnd.c b/yasnd.c index c33db8a..f63cc83 100644 --- a/yasnd.c +++ b/yasnd.c @@ -334,29 +334,12 @@ int main(void) { /* Our process ID and Session ID */ pid_t pid, sid; - /* Fork off the parent process */ - pid = fork(); - if (pid < 0) { - exit(EXIT_FAILURE); - } - /* If we got a good PID, then we can exit the parent process. */ - if (pid > 0) { - exit(EXIT_SUCCESS); - } - /* Change the file mode mask */ umask(0); /* Open any logs here */ openlog("yasnd", LOG_PID|LOG_CONS, LOG_USER); - /* Create a new SID for the child process */ - sid = setsid(); - if (sid < 0) { - /* Log the failure */ - exit(EXIT_FAILURE); - } - /* Change the current working directory */ if ((chdir("/")) < 0) { /* Log the failure */