Vanilla Development Maling List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS update: Vanilla/ntserv



Date:	Friday March 12, 1999 @ 18:57
Author:	cameron

Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory cvs.castle.real-time.com:/var/tmp/cvs-serv8359/ntserv

Modified Files:
	main.c 
Log Message:
fix daemon inheritance of ntserv client socket

****************************************

Index: Vanilla/ntserv/main.c
diff -u Vanilla/ntserv/main.c:1.4 Vanilla/ntserv/main.c:1.5
--- Vanilla/ntserv/main.c:1.4	Sun Feb 14 20:43:42 1999
+++ Vanilla/ntserv/main.c	Fri Mar 12 18:57:09 1999
@@ -111,6 +111,10 @@
     if (argc > 0)
 	host = argv[0];
     srandom((int)getpid() * time((time_t *) 0));
+
+    /* avoid having daemon (started by openmem) inherit our socket */
+    fcntl(0, F_SETFD, FD_CLOEXEC);
+
     /* this finds the shared memory information */
     openmem(1);
     readsysdefaults();
@@ -125,7 +129,7 @@
 	    exit(0);
 	}
     } else {
-	sock=0;	/* Because we were forked by inetd! */
+	sock=0;			/* newstartd gives us our connection on 0 */
 	checkSocket();
 	initClientData();	/* "normally" called by connectToClient() */
     }