commit 792f302acee3122ed0f9469d8676dbb271f60849 from: Omar Polo date: Fri Jun 09 17:27:41 2023 UTC use fatal/fatalx instead of err/errx in daemon code commit - 68368f4c29e208c67724b04fd0142e233a247a2a commit + 792f302acee3122ed0f9469d8676dbb271f60849 blob - a9616eb98d9527801527555652f4669f7346f1c9 blob + ffc37990b43dc22f237036173b175d23809e64aa --- gmid.c +++ gmid.c @@ -126,7 +126,7 @@ log_request(struct client *c, char *meta, size_t l) ec = asprintf(&fmted, "%s:%s GET %s %.*s", hbuf, sbuf, b, (int)(t-meta), meta); if (ec == -1) - err(1, "asprintf"); + fatal("asprintf"); proc_compose(conf->ps, PROC_LOGGER, IMSG_LOG_REQUEST, fmted, ec + 1); @@ -231,7 +231,7 @@ main(int argc, char **argv) conf = config_new(); if (parse_conf(conf, config_path) == -1) - errx(1, "failed to load configuration file"); + fatalx("failed to load configuration file"); if (*conf->chroot != '\0' && *conf->user == '\0') fatalx("can't chroot without a user to switch to after."); blob - 11d4250da12f95f67ac51634d203258c9c172c5d blob + ecbb7281a15eeca6a4397ebb93fd161b2a0a2d2c --- parse.y +++ parse.y @@ -442,7 +442,7 @@ fastcgi : string { | TCP string PORT NUM { char *c; if (asprintf(&c, "%d", $4) == -1) - err(1, "asprintf"); + fatal("asprintf"); loc->fcgi = fastcgi_conf($2, c); free($2); } @@ -476,7 +476,7 @@ medianames_l : medianames_l medianamesl medianamesl : numberstring { if (add_mime(&conf->mime, current_media, $1) == -1) - err(1, "add_mime"); + fatal("add_mime"); free($1); } ; blob - 9aac9dfbb42216fc0f8b8db86ffc8ca5353d8187 blob + b8f09c78a7371abd6765f332139af72ee4e58c67 --- utils.c +++ utils.c @@ -77,13 +77,13 @@ absolutify_path(const char *path) if (*path == '/') { if ((r = strdup(path)) == NULL) - err(1, "strdup"); + fatal("strdup"); return r; } wd = getcwd(NULL, 0); if (asprintf(&r, "%s/%s", wd, path) == -1) - err(1, "asprintf"); + fatal("asprintf"); free(wd); return r; } @@ -94,7 +94,7 @@ xstrdup(const char *s) char *d; if ((d = strdup(s)) == NULL) - err(1, "strdup"); + fatal("strdup"); return d; } @@ -104,7 +104,7 @@ xcalloc(size_t nmemb, size_t size) void *d; if ((d = calloc(nmemb, size)) == NULL) - err(1, "calloc"); + fatal("calloc"); return d; }