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
|
||||
daemonize_set_user();
|
||||
daemonize_begin(options.daemon);
|
||||
AtScopeExit() { daemonize_finish(); };
|
||||
#endif
|
||||
|
||||
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;
|
||||
instance = nullptr;
|
||||
|
||||
#ifdef ENABLE_DAEMON
|
||||
daemonize_finish();
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user