commit e075021085c1b1f8d28c35d2f358f7792980b0d1 from: Omar Polo date: Mon Jul 24 14:07:28 2023 UTC still respect `log' when in debug mode commit - e5f060f0d209b0d77bfcf0e087dca70702c8c14a commit + e075021085c1b1f8d28c35d2f358f7792980b0d1 blob - cc186d5e7ce14c92abb13f9723964dbac2e1decb blob + d5794340a90748c089d7dd4853c57a1720c94e95 --- gmid.c +++ gmid.c @@ -118,6 +118,9 @@ log_request(struct client *c, int code, const char *me code, meta); if (ec == -1) fatal("asprintf"); + + if (debug) + fprintf(stderr, "%s\n", fmted); proc_compose(conf->ps, PROC_LOGGER, IMSG_LOG_REQUEST, fmted, ec + 1); @@ -325,9 +328,6 @@ main_send_logfd(struct conf *conf) char path[PATH_MAX]; int r, fd = -1; - if (debug) - return 0; - if (conf->log_access) { r = snprintf(path, sizeof(path), "%s%s%s", conf->chroot, *conf->chroot == '\0' ? "" : "/", conf->log_access); blob - 97de2011d61ccd1352484c6c70f7bdbdc011855c blob + 5cdabca2b77c9fc8761a95856f082af9984fd64b --- logger.c +++ logger.c @@ -37,7 +37,7 @@ #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) #endif -static int logfd = 2; /* stderr */ +static int logfd = -1; static void logger_init(struct privsep *, struct privsep_proc *, void *); static void logger_shutdown(void);