summaryrefslogtreecommitdiffstats
path: root/src/journal
diff options
context:
space:
mode:
authorVito Caputo <vito.caputo@coreos.com>2016-02-23 05:00:13 +0100
committerVito Caputo <vito.caputo@coreos.com>2016-02-23 05:00:13 +0100
commitec9ffa2cdd931d8ab8ac0d90b1d9eff180a07288 (patch)
tree02a919eac89b5a41e66441cdb4c41bf681f09a58 /src/journal
parentMerge pull request #2706 from whot/hwdb-updates (diff)
downloadsystemd-ec9ffa2cdd931d8ab8ac0d90b1d9eff180a07288.tar.xz
systemd-ec9ffa2cdd931d8ab8ac0d90b1d9eff180a07288.zip
journal: restore offline state on error
If we fail to create the thread, technically we should leave the offline_state as OFFLINE_JOINED, not OFFLINE_SYNCING.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journal-file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index f5e2952c99..80e34f6e8b 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -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;