summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vito.caputo@coreos.com>2016-02-22 20:00:13 -0800
committerVito Caputo <vito.caputo@coreos.com>2016-02-22 20:00:13 -0800
commitec9ffa2cdd931d8ab8ac0d90b1d9eff180a07288 (patch)
tree02a919eac89b5a41e66441cdb4c41bf681f09a58 /src
parentc4bcaa4148fbfe977a551cdd0b1209a416ede586 (diff)
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')
-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;