chiark / gitweb /
journal: when we shall go down do so cleanly
authorLennart Poettering <lennart@poettering.net>
Sun, 22 Dec 2013 20:10:06 +0000 (21:10 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 22 Dec 2013 20:12:25 +0000 (21:12 +0100)
src/journal/journald.c

index aa12fa7..37896d0 100644 (file)
@@ -72,6 +72,12 @@ int main(int argc, char *argv[]) {
         for (;;) {
                 usec_t t = (usec_t) -1, n;
 
+                r = sd_event_get_state(server.event);
+                if (r < 0)
+                        goto finish;
+                if (r == SD_EVENT_FINISHED)
+                        break;
+
                 n = now(CLOCK_REALTIME);
 
                 if (server.max_retention_usec > 0 && server.oldest_file_usec > 0) {