[BusyBox-cvs] busybox/networking/udhcp common.c,1.4,1.5

Russ Dill russ at busybox.net
Fri Dec 26 23:41:31 UTC 2003


Update of /var/cvs/busybox/networking/udhcp
In directory nail:/tmp/cvs-serv583

Modified Files:
	common.c 
Log Message:
it should work even if you don't assign a pidfile

Index: common.c
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/common.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- common.c	18 Dec 2003 22:25:38 -0000	1.4
+++ common.c	26 Dec 2003 23:41:28 -0000	1.5
@@ -59,15 +59,14 @@
 #else /* __uClinux__ */
 	int pid_fd;
 
-	if (!pidfile) return;
-
-	pid_fd = pidfile_acquire(pidfile); /* hold lock during fork. */
+	/* hold lock during fork. */
+	if (pidfile) pid_fd = pidfile_acquire(pidfile);
 	if (daemon(0, 0) == -1) {
 		perror("fork");
 		exit(1);
 	}
 	daemonized++;
-	pidfile_write_release(pid_fd);
+	if (pidfile) pidfile_write_release(pid_fd);
 #endif /* __uClinux__ */
 }
 
@@ -97,8 +96,10 @@
 	sanitize_fds();
 
 	/* do some other misc startup stuff while we are here to save bytes */
-	pid_fd = pidfile_acquire(pidfile);
-	pidfile_write_release(pid_fd);
+	if (pidfile) {
+		pid_fd = pidfile_acquire(pidfile);
+		pidfile_write_release(pid_fd);
+	}
 
 	/* equivelent of doing a fflush after every \n */
 	setlinebuf(stdout);




More information about the busybox-cvs mailing list