stop if logfile cannot be opened in daemon mode

This commit is contained in:
john30
2019-08-15 18:38:49 +02:00
parent 28f79290ed
commit c2163d683e
Executable → Regular
+4 -1
View File
@@ -1293,7 +1293,10 @@ int main(int argc, char* argv[]) {
}
if (!opt.foreground) {
setLogFile(opt.logFile);
if (!setLogFile(opt.logFile)) {
logError(lf_main, "unable to open log file %s", opt.logFile);
return EINVAL;
}
daemonize(); // make me daemon
}