Skip to contentSkip to conversation

cluster/fence/fenced main.c

Cluster-devel [email protected] 1 participant 1 message Nov 30, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2006-11-30 23:56:03

Modified files:
fence/fenced : main.c

Log message:
Fix bug where fence agents were getting info up to groupd

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fenced/main.c.diff?cvsroot=cluster&r1=1.38&r2=1.39

fence/fenced/main.c +2 -8
@@ -583,19 +583,13 @@
 	client_init();
 
 	if (!daemon_debug_opt) {
-		pid_t pid = fork();
-		if (pid < 0) {
+		if (daemon(0,0) < 0) {
 			perror("main: cannot fork");
 			exit(EXIT_FAILURE);
 		}
-		if (pid)
-			exit(EXIT_SUCCESS);
-		setsid();
+		
 		chdir("/");
 		umask(0);
-		close(0);
-		close(1);
-		close(2);
 		openlog("fenced", LOG_PID, LOG_DAEMON);
 	}