Commit Diff


commit - 5e98fb339b4588f8e07c12b9f9ace9dbdcc47592
commit + 0f91044a8e1edfa553268e8437f58c21e1e4ac39
blob - 4a8874a87e47d8824f253f466514c16f8ce8c881
blob + b53d5eff71873cc7e138a6b88fc6f313800c0701
--- gotwebd/config.c
+++ gotwebd/config.c
@@ -214,7 +214,7 @@ config_getsock(struct gotwebd *env, struct imsg *imsg)
 	for (i = 0; i < PRIV_FDS__MAX; i++)
 		sock->priv_fd[i] = -1;
 
-	for (i = 0; i < GOT_PACK_NUM_TEMPFILES; i++)
+	for (i = 0; i < GOTWEB_PACK_NUM_TEMPFILES; i++)
 		sock->pack_fds[i] = -1;
 
 	/* log new socket info */
@@ -240,9 +240,9 @@ config_setfd(struct gotwebd *env, struct socket *sock)
 	unsigned int what;
 
 	log_debug("%s: Allocating %d file descriptors",
-	    __func__, PRIV_FDS__MAX + GOT_PACK_NUM_TEMPFILES);
+	    __func__, PRIV_FDS__MAX + GOTWEB_PACK_NUM_TEMPFILES);
 
-	for (j = 0; j < PRIV_FDS__MAX + GOT_PACK_NUM_TEMPFILES; j++) {
+	for (j = 0; j < PRIV_FDS__MAX + GOTWEB_PACK_NUM_TEMPFILES; j++) {
 		for (id = 0; id < PROC_MAX; id++) {
 			what = ps->ps_what[id];
 
@@ -300,7 +300,8 @@ config_getfd(struct gotwebd *env, struct imsg *imsg)
 	memcpy(&sock_id, p, sizeof(sock_id));
 
 	TAILQ_FOREACH(sock, env->sockets, entry) {
-		for (i = 0; i < (GOT_PACK_NUM_TEMPFILES + PRIV_FDS__MAX); i++) {
+		const int nfds = (GOTWEB_PACK_NUM_TEMPFILES + PRIV_FDS__MAX);
+		for (i = 0; i < nfds; i++) {
 			if (i < PRIV_FDS__MAX && sock->priv_fd[i] == -1) {
 				log_debug("%s: assigning socket %d priv_fd %d",
 				    __func__, sock_id, imsg->fd);
blob - dc7c84efaf6ec6c1ee3babbaf8c49795d4e21dd6
blob + 789ae140f9fb7ff7c3be4252259d46cc4164ec0f
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
@@ -109,8 +109,7 @@
 #define FCGI_OVERLOADED		2
 #define FCGI_UNKNOWN_ROLE	3
 
-/* XXX: move this later after ig */
-#define GOT_PACK_NUM_TEMPFILES     32
+#define GOTWEB_PACK_NUM_TEMPFILES     32
 
 enum imsg_type {
 	IMSG_CFG_SRV = IMSG_PROC_MAX,
@@ -320,7 +319,7 @@ struct socket {
 	struct socket_conf	 conf;
 
 	int		 fd;
-	int		 pack_fds[GOT_PACK_NUM_TEMPFILES];
+	int		 pack_fds[GOTWEB_PACK_NUM_TEMPFILES];
 	int		 priv_fd[PRIV_FDS__MAX];
 
 	struct event	 evt;