commit - b2ce80908e83c8a29aab68c76588a41813f13a74
commit + 9ec8edf7c3ed58660d5ce984a55bbafbd9a23fb9
blob - 96fd5c7c164275779cca5fd8206b15f4af564a94
blob + aeb7899ca94b67c3cdb0073a8c958e4090cc27ea
--- gotwebd/gotwebd.c
+++ gotwebd/gotwebd.c
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");
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 - d47297375a5f9fe3888d5e964455fbc3a3d9416a
blob + a76ef44049655b82575dc5a398b4739eeb44efbc
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
#define GOTWEBD_MAXPORT 6
#define GOTWEBD_NUMPROC 3
#define GOTWEBD_REPO_CACHESIZE 4
+#define GOTWEBD_SOCK_FILENO 3
#define PROC_MAX_INSTANCES 32