summaryrefslogtreecommitdiff
blob: 73c26e4d1b93de3f25807638238c6823afa9fc38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff -ur a/noip2.c b/noip2.c
--- a/noip2.c	2004-01-09 14:18:39.000000000 +0000
+++ b/noip2.c	2007-07-20 14:02:41.100377515 +0100
@@ -894,16 +894,13 @@
 	int	x, delay;
 	char	*err_string;
 
-	x = fork();
+	x = daemon (0, 0);
 	switch (x) {
 	    case -1:		// error
 		err_string = strerror(errno);
 		Msg( "Can't fork!! (%s) Ending!\n", err_string);
 		return FATALERR;
-	    default:		// parent
-		exit(0);
 	    case 0:		//child
-		setsid();
 		if (get_shm_info() == FATALERR)	
 		    return FATALERR;
 		log2syslog++;