stop if logfile cannot be opened in daemon mode
This commit is contained in:
Executable → Regular
+4
-1
@@ -1293,7 +1293,10 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!opt.foreground) {
|
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
|
daemonize(); // make me daemon
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user