commit 2382c6029fcaf1cfe733542c1779461f0b1251ff from: Omar Polo via: Thomas Adam date: Sun May 26 14:05:41 2024 UTC gotwebd: remove unix_socket_name Now that `listen' is a top-level, `unix_socket_name' is useless. The default socket remains /var/www/run/gotweb.sock, to listen on an alternate socket now `listen on socket "/some/other/sock" can be used. part of a larger diff that's ok stsp@ commit - 61d4bd062ed92c7c334c663c16f86fd80d09edf7 commit + 2382c6029fcaf1cfe733542c1779461f0b1251ff blob - 3f49c317df61f0920a4cbe046bf927f5ead20532 blob + 22e1f652d4a563c1443ad56608ce3b0afdf22854 --- gotwebd/gotwebd.conf.5 +++ gotwebd/gotwebd.conf.5 @@ -77,10 +77,6 @@ May be specified multiple times to build up a list of Run the specified number of server processes. .Xr gotwebd 8 runs 3 server processes by default. -.It Ic unix_socket_name Ar path -Set the path to the default unix socket. -Defaults to -.Pa /var/www/run/gotweb.sock . .El .Pp If no blob - 5d08e6330815244d0f093676cb7171f5881355b9 blob + 9413f1ab4e81bf24df462f3892f09400e6b1942d --- gotwebd/gotwebd.h +++ gotwebd/gotwebd.h @@ -365,8 +365,6 @@ struct gotwebd { int server_cnt; char httpd_chroot[PATH_MAX]; - - char unix_socket_name[PATH_MAX]; }; /* blob - 15d246c916137d3d1efe5080a25591b154346650 blob + c9cad22287e14d2e41713cae36dc59881d492819 --- gotwebd/parse.y +++ gotwebd/parse.y @@ -114,7 +114,7 @@ typedef struct { %token LOGO_URL SHOW_REPO_OWNER SHOW_REPO_AGE SHOW_REPO_DESCRIPTION %token MAX_REPOS_DISPLAY REPOS_PATH MAX_COMMITS_DISPLAY ON ERROR %token SHOW_SITE_OWNER SHOW_REPO_CLONEURL PORT PREFORK RESPECT_EXPORTOK -%token UNIX_SOCKET_NAME SERVER CHROOT CUSTOM_CSS SOCKET +%token SERVER CHROOT CUSTOM_CSS SOCKET %token SUMMARY_COMMITS_DISPLAY SUMMARY_TAGS_DISPLAY %token STRING @@ -198,19 +198,6 @@ main : PREFORK NUMBER { sizeof(gotwebd->httpd_chroot)); if (n >= sizeof(gotwebd->httpd_chroot)) { yyerror("%s: httpd_chroot truncated", __func__); - free($2); - YYERROR; - } - free($2); - } - | UNIX_SOCKET_NAME STRING { - n = snprintf(gotwebd->unix_socket_name, - sizeof(gotwebd->unix_socket_name), "%s%s", - gotwebd->httpd_chroot, $2); - if (n < 0 || - (size_t)n >= sizeof(gotwebd->unix_socket_name)) { - yyerror("%s: unix_socket_name truncated", - __func__); free($2); YYERROR; } @@ -473,7 +460,6 @@ lookup(char *s) { "socket", SOCKET }, { "summary_commits_display", SUMMARY_COMMITS_DISPLAY }, { "summary_tags_display", SUMMARY_TAGS_DISPLAY }, - { "unix_socket_name", UNIX_SOCKET_NAME }, }; const struct keywords *p; @@ -806,18 +792,12 @@ int parse_config(const char *filename, struct gotwebd *env) { struct sym *sym, *next; - int n; if (config_init(env) == -1) fatalx("failed to initialize configuration"); gotwebd = env; - n = snprintf(env->unix_socket_name, sizeof(env->unix_socket_name), - "%s%s", D_HTTPD_CHROOT, D_UNIX_SOCKET); - if (n < 0 || (size_t)n >= sizeof(env->unix_socket_name)) - fatalx("%s: snprintf", __func__); - file = newfile(filename, 0); if (file == NULL) { add_default_server();