Since we now waitpid on WAIT_ANY, pop3_main needed return pid.
authorSunil Nimmagadda <sunil@sunilnimmagadda.com>
Thu, 10 Apr 2014 18:15:50 +0500
changeset 14 1f2f363d10cc
parent 11 12ebfb79038d
child 15 a32f6ca3e290
Since we now waitpid on WAIT_ANY, pop3_main needed return pid.
pop3d.c
pop3d.h
pop3e.c
--- a/pop3d.c	Wed Apr 09 21:36:45 2014 -0400
+++ b/pop3d.c	Thu Apr 10 18:15:50 2014 +0500
@@ -47,7 +47,6 @@
 static void usage(void);
 
 static struct imsgev	iev_pop3e;
-static pid_t		pop3e_pid;
 static const char	*mpath = MBOX_PATH;
 static int		mtype = M_MBOX;
 
@@ -99,7 +98,7 @@
 	if ((pw = getpwnam(POP3D_USER)) == NULL)
 		fatalx("main: getpwnam " POP3D_USER);
 
-	pop3e_pid = pop3_main(pair, pw);
+	pop3_main(pair, pw);
 	close(pair[1]);
 	setproctitle("[priv]");
 	logit(LOG_INFO, "pop3d ready; type:%s, path:%s", mtype_str, mpath);
--- a/pop3d.h	Wed Apr 09 21:36:45 2014 -0400
+++ b/pop3d.h	Thu Apr 10 18:15:50 2014 +0500
@@ -144,7 +144,7 @@
 };
 
 /* pop3e.c */
-pid_t pop3_main(int [2], struct passwd *);
+void pop3_main(int [2], struct passwd *);
 
 /* session.c */
 void session_init(struct listener *, int);
--- a/pop3e.c	Wed Apr 09 21:36:45 2014 -0400
+++ b/pop3e.c	Thu Apr 10 18:15:50 2014 +0500
@@ -47,7 +47,7 @@
 struct imsgev		iev_pop3d;
 void			*ssl_ctx;
 
-pid_t
+void
 pop3_main(int pair[2], struct passwd *pw)
 {
 	extern struct session_tree	sessions;
@@ -59,7 +59,7 @@
 		fatal("pop3e: fork");
 
 	if (pid > 0)
-		return (pid);
+		return;
 
 	close(pair[0]);
 	setproctitle("pop3 engine");