From ec9ffa2cdd931d8ab8ac0d90b1d9eff180a07288 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 22 Feb 2016 20:00:13 -0800 Subject: 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. --- src/journal/journal-file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-54-g00ecf