commit e80b37ed23f3a4daa623c92b650c7049a8157d66 from: Stefan Sperling via: Thomas Adam date: Fri Jul 22 20:11:58 2022 UTC fix name clash in gotwebd Rename GOT_PACK_NUM_TEMPFILES in gotwebd, since it clashes with a name already used in lib/repository.c. ok tracey commit - 1be4947a5c2d3f42e8dda37929997907d116b746 commit + e80b37ed23f3a4daa623c92b650c7049a8157d66 blob - e8f256ef8ff4f5e92a6bc9bc0615d33b1b05140b blob + e8aec5bdf956a12e5a7477e7a16635ba28f99613 --- 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;