From 58c71758b7ab31f0db1e20cf46492d90532ba4ad Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Sun, 14 Mar 2004 20:56:38 +0000
Subject: [PATCH] Modified comments regarding pidfile to make sense so I don't
 try moving it all around again.

---
 src/sbbs3/sbbscon.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/sbbs3/sbbscon.c b/src/sbbs3/sbbscon.c
index 86e84b29e0..ecba4dc7a4 100644
--- a/src/sbbs3/sbbscon.c
+++ b/src/sbbs3/sbbscon.c
@@ -860,13 +860,16 @@ daemon(nochdir, noclose)
 #endif /* NEEDS_DAEMON */
 
 static void handle_sigs(void)  {
-	int		sig;
-	sigset_t			sigs;
+	int			sig;
+	sigset_t	sigs;
 	char		str[1024];
 
 	thread_up(NULL,TRUE,TRUE);
 
 	if (is_daemon) {
+		/* Write the standard .pid file if running as a daemon */
+		/* Must be here so signals are sent to the correct thread */
+
 		if(pidfile!=NULL) {
 			fprintf(pidfile,"%d",getpid());
 			fclose(pidfile);
@@ -1469,12 +1472,9 @@ int main(int argc, char** argv)
 			is_daemon=FALSE;
 		}
 
-		/* Write the standard .pid file if running as a daemon */
-		/* Must be here so signals are sent to the correct thread */
-
+		/* Open here to use startup permissions to create the file */
 		pidfile=fopen(SBBS_PID_FILE,"w");
 	}
-
 	old_uid = getuid();
 	if((pw_entry=getpwnam(new_uid_name))!=0)
 	{
-- 
GitLab