Main: call daemonize_finish() with AtScopeExit()
This commit is contained in:
parent
b4c517c501
commit
fbfefcc0a3
@ -526,6 +526,7 @@ MainOrThrow(int argc, char *argv[])
|
|||||||
#ifdef ENABLE_DAEMON
|
#ifdef ENABLE_DAEMON
|
||||||
daemonize_set_user();
|
daemonize_set_user();
|
||||||
daemonize_begin(options.daemon);
|
daemonize_begin(options.daemon);
|
||||||
|
AtScopeExit() { daemonize_finish(); };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return mpd_main_after_fork(raw_config, config);
|
return mpd_main_after_fork(raw_config, config);
|
||||||
@ -715,10 +716,6 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
|
|||||||
delete instance;
|
delete instance;
|
||||||
instance = nullptr;
|
instance = nullptr;
|
||||||
|
|
||||||
#ifdef ENABLE_DAEMON
|
|
||||||
daemonize_finish();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user