From e1a3aebafca9a9447a393100db4fc45943551630 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 31 Oct 2017 14:04:03 +0100 Subject: Ensure we get an appropriate exit code when a resource crashes. --- sinksh/syntax_modules/sink_sync.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sinksh/syntax_modules') 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) Sink::Store::synchronize(query) .then(Sink::ResourceControl::flushMessageQueue(query.getResourceFilter().ids)) .then([state](const KAsync::Error &error) { + int exitCode = 0; if (error) { state.printLine("Synchronization failed!"); + exitCode = 1; } else { state.printLine("Synchronization complete!"); } - state.commandFinished(); + state.commandFinished(exitCode); }).exec(); return true; -- cgit v1.2.3