commit da64fca0d1dd094bdc5e399298ffbcb3f935d11d from: Stefan Sperling date: Mon Sep 08 09:28:25 2025 UTC remove the now unused "server_cnt" gotwebd variable commit - cf4650e179df57c8f7e985b49948138547765af7 commit + da64fca0d1dd094bdc5e399298ffbcb3f935d11d blob - 24a9352100d646dad06a2b1e5b107b6a99b471b8 blob + 5b6c4f611de441b8dee08ed52fd642dff811ef24 --- gotwebd/config.c +++ gotwebd/config.c @@ -53,7 +53,6 @@ config_init(struct gotwebd *env) strlcpy(env->httpd_chroot, D_HTTPD_CHROOT, sizeof(env->httpd_chroot)); env->prefork = GOTWEBD_NUMPROC; - env->server_cnt = 0; TAILQ_INIT(&env->servers); TAILQ_INIT(&env->sockets); TAILQ_INIT(&env->addresses); blob - 5f72ef9e31fdd912c972f55367db8538e012b9b9 blob + 600ae4ab3ee85bedda503b83acca5478add18573 --- gotwebd/gotwebd.c +++ gotwebd/gotwebd.c @@ -369,13 +369,8 @@ spawn_process(struct gotwebd *env, const char *argv0, argv[argc++] = "-F"; argv[argc++] = username; } else if (proc_type == GOTWEBD_PROC_GOTWEB) { - char *s; - argv[argc++] = "-G"; argv[argc++] = username; - if (asprintf(&s, "-G%d", env->server_cnt) == -1) - fatal("asprintf"); - argv[argc++] = s; } if (strcmp(env->gotwebd_conffile, GOTWEBD_CONF) != 0) { argv[argc++] = "-f"; @@ -448,11 +443,7 @@ main(int argc, char **argv) break; case 'G': proc_type = GOTWEBD_PROC_GOTWEB; - i = strtonum(optarg, 1, INT_MAX, &errstr); - if (errstr) - gotwebd_username = optarg; - else - env->server_cnt = i; + gotwebd_username = optarg; break; case 'f': conffile = optarg; blob - 264aea1b3238702f4213e6d79fcfb8d45ebb2f41 blob + 6489b482539e9ef0150b04e9a512b49639c16e3d --- gotwebd/gotwebd.h +++ gotwebd/gotwebd.h @@ -421,8 +421,6 @@ struct gotwebd { int gotweb_pending; int gotweb_cur; int *worker_load; - - int server_cnt; char httpd_chroot[PATH_MAX]; }; blob - f6da39132c94a229b98735aa2e9a44a4d415076d blob + 49402203bcfefd1783a8fe05ceee15fb09a60d9e --- gotwebd/parse.y +++ gotwebd/parse.y @@ -843,7 +843,7 @@ parse_config(const char *filename, struct gotwebd *env } /* just add default server if no config specified */ - if (gotwebd->server_cnt == 0) + if (TAILQ_EMPTY(&gotwebd->servers)) add_default_server(); /* add the implicit listen on socket */ @@ -929,7 +929,6 @@ conf_new_server(const char *name) srv->summary_tags_display = D_MAXSLTAGDISP; TAILQ_INSERT_TAIL(&gotwebd->servers, srv, entry); - gotwebd->server_cnt++; return srv; };