Main: notify systemd when MPD is ready

This commit is contained in:
Max Kellermann 2015-03-21 14:18:15 +01:00
parent 400e3ea649
commit 7b575f61d0

View File

@ -106,6 +106,10 @@
#include <glib.h>
#endif
#ifdef ENABLE_SYSTEMD_DAEMON
#include <systemd/sd-daemon.h>
#endif
#include <stdlib.h>
#ifdef HAVE_LOCALE_H
@ -662,6 +666,10 @@ static int mpd_main_after_fork(struct options options)
a huge value to allow the kernel to reduce CPU wakeups */
SetThreadTimerSlackMS(100);
#ifdef ENABLE_SYSTEMD_DAEMON
sd_notify(0, "READY=1");
#endif
/* run the main loop */
instance->event_loop->Run();