Commit Diff


commit - 7f722d7ca7646a910da609fd4240e6b666c564dc
commit + 07226cf792be7df8fc8060ee426e20670bcb366e
blob - efad396a4f83d1910bb9700fcc160fdb9cc9b687
blob + 853657757043f3f941a13e6f14ebd5391ec75b02
--- gotwebd/config.c
+++ gotwebd/config.c
@@ -54,7 +54,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 - 2f73110cb2228a1cabcbcc6fc2e90b4f8f6c6f49
blob + 8c488fc0867abc93a3343e161d7144f9d29b13ab
--- gotwebd/gotwebd.c
+++ gotwebd/gotwebd.c
@@ -368,13 +368,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";
@@ -447,11 +442,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 - 65b596837a8e6b7c519539990d6e73bf5253709b
blob + 97ec22290beca05e6559e486e6497dcad058d4b2
--- gotwebd/parse.y
+++ gotwebd/parse.y
@@ -844,7 +844,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 */
@@ -930,7 +930,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;
 };