diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-31 14:04:03 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-31 14:04:03 +0100 |
commit | e1a3aebafca9a9447a393100db4fc45943551630 (patch) | |
tree | 39672297b576e967bd2448d6a795e5485f6995b7 /sinksh/syntax_modules/sink_sync.cpp | |
parent | 77b2173e73f16f33648226543788ea67096fb6d6 (diff) | |
download | sink-e1a3aebafca9a9447a393100db4fc45943551630.tar.gz sink-e1a3aebafca9a9447a393100db4fc45943551630.zip |
Ensure we get an appropriate exit code when a resource crashes.
Diffstat (limited to 'sinksh/syntax_modules/sink_sync.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_sync.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sinksh/syntax_modules/sink_sync.cpp b/sinksh/syntax_modules/sink_sync.cpp index 2800af1..8b48785 100644 --- a/sinksh/syntax_modules/sink_sync.cpp +++ b/sinksh/syntax_modules/sink_sync.cpp | |||
@@ -67,12 +67,14 @@ bool sync(const QStringList &args, State &state) | |||
67 | Sink::Store::synchronize(query) | 67 | Sink::Store::synchronize(query) |
68 | .then(Sink::ResourceControl::flushMessageQueue(query.getResourceFilter().ids)) | 68 | .then(Sink::ResourceControl::flushMessageQueue(query.getResourceFilter().ids)) |
69 | .then([state](const KAsync::Error &error) { | 69 | .then([state](const KAsync::Error &error) { |
70 | int exitCode = 0; | ||
70 | if (error) { | 71 | if (error) { |
71 | state.printLine("Synchronization failed!"); | 72 | state.printLine("Synchronization failed!"); |
73 | exitCode = 1; | ||
72 | } else { | 74 | } else { |
73 | state.printLine("Synchronization complete!"); | 75 | state.printLine("Synchronization complete!"); |
74 | } | 76 | } |
75 | state.commandFinished(); | 77 | state.commandFinished(exitCode); |
76 | }).exec(); | 78 | }).exec(); |
77 | 79 | ||
78 | return true; | 80 | return true; |