1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

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.
This commit is contained in:
Vito Caputo 2016-02-22 20:00:13 -08:00
parent c4bcaa4148
commit ec9ffa2cdd

View 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;