diff options
author | Omar Polo <op@omarpolo.com> | 2023-07-24 08:50:49 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-07-24 08:50:49 +0000 |
commit | 226f13ece0b309abeee0ae8a4d8c9f049fe896a7 (patch) | |
tree | bb0d3efb3ff5064a04335eca0d615444f7696655 /gmid.c | |
parent | 3826d7de43d3b9078c5e18e0074799a3a9ee682e (diff) |
add ability to log to files with log access <path>
Diffstat (limited to 'gmid.c')
-rw-r--r-- | gmid.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -320,6 +320,16 @@ static int main_configure(struct conf *conf) { struct privsep *ps = conf->ps; + int fd = -1; + + if (!debug) { + if (conf->log_access && (fd = open(conf->log_access, + O_WRONLY|O_CREAT|O_APPEND, 0600)) == -1) + log_warn("can't open %s", conf->log_access); + if (proc_compose_imsg(ps, PROC_LOGGER, -1, IMSG_LOG_TYPE, + -1, fd, NULL, 0) == -1) + return -1; + } conf->reload = conf->prefork + 1; /* servers, crypto */ |