]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: restore offline state on error 2708/head
authorVito Caputo <vito.caputo@coreos.com>
Tue, 23 Feb 2016 04:00:13 +0000 (20:00 -0800)
committerVito Caputo <vito.caputo@coreos.com>
Tue, 23 Feb 2016 04:00:13 +0000 (20:00 -0800)
If we fail to create the thread, technically we should leave the
offline_state as OFFLINE_JOINED, not OFFLINE_SYNCING.

src/journal/journal-file.c

index f5e2952c997a7ab4f2143fc266e2a6291e71ef46..80e34f6e8b4818c6f7aa53647165fd961c1a94fd 100644 (file)
@@ -238,8 +238,10 @@ int journal_file_set_offline(JournalFile *f, bool wait) {
                 journal_file_set_offline_internal(f);
         else {
                 r = pthread_create(&f->offline_thread, NULL, journal_file_set_offline_thread, f);
-                if (r > 0)
+                if (r > 0) {
+                        f->offline_state = OFFLINE_JOINED;
                         return -r;
+                }
         }
 
         return 0;