Commit Diff


commit - 3bb657abe5b3a3d888deadbdc094637dd505dce0
commit + f1e20d011992c8e84558cc639c80e53420e2054b
blob - 7e31416650c0a4ab9b782f2537ab2cf69b10993a
blob + f4bc8c3f50a4676acbe25f2c6fcc0beae51c08d9
--- gotwebd/gotwebd.c
+++ gotwebd/gotwebd.c
@@ -242,8 +242,8 @@ spawn_socket_process(struct gotwebd *env, const char *
 		argv[argc++] = "-v";
 	argv[argc] = NULL;
 
-	if (p[0] != 3) {
-		if (dup2(p[0], 3) == -1)
+	if (p[0] != GOTWEBD_SOCK_FILENO) {
+		if (dup2(p[0], GOTWEBD_SOCK_FILENO) == -1)
 			fatal("dup2");
 	} else if (fcntl(p[0], F_SETFD, 0) == -1)
 		fatal("fcntl");
@@ -351,7 +351,7 @@ main(int argc, char **argv)
 		    setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1)
 			fatal("failed to drop privileges");
 
-		sockets(env, 3);
+		sockets(env, GOTWEBD_SOCK_FILENO);
 		return 1;
 	}
 
blob - fd2973c33fb3621793863c961b07ab4fa811ba36
blob + bb9f162ecc3b44d973ee60be9445e234cd5f9986
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
@@ -50,6 +50,7 @@
 #define GOTWEBD_MAXPORT		 6
 #define GOTWEBD_NUMPROC		 3
 #define GOTWEBD_REPO_CACHESIZE	 4
+#define GOTWEBD_SOCK_FILENO	 3
 
 #define PROC_MAX_INSTANCES	 32