#include <errno.h>
#include <unistd.h>
-#include <systemd/sd-journal.h>
-#include <systemd/sd-messages.h>
-#include <systemd/sd-daemon.h>
+#include "systemd/sd-journal.h"
+#include "systemd/sd-messages.h"
+#include "systemd/sd-daemon.h"
#include "journal-authenticate.h"
#include "journald-server.h"
"STATUS=Processing requests...");
for (;;) {
- usec_t t = (usec_t) -1, n;
+ usec_t t = USEC_INFINITY, n;
r = sd_event_get_state(server.event);
if (r < 0)
r = sd_event_run(server.event, t);
if (r < 0) {
- log_error("Failed to run event loop: %s", strerror(-r));
+ log_error_errno(r, "Failed to run event loop: %m");
goto finish;
}
server_driver_message(&server, SD_MESSAGE_JOURNAL_STOP, "Journal stopped");
finish:
- sd_notify(false, "STATUS=Shutting down...");
+ sd_notify(false,
+ "STOPPING=1\n"
+ "STATUS=Shutting down...");
server_done(&server);