From 6004a007c5bd51b95df2ade94d8e67a635369f36 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 15 Apr 2016 16:25:40 +0200 Subject: Set program return codes --- src/DabMux.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/DabMux.cpp b/src/DabMux.cpp index d09fdd2..94e292f 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -485,12 +485,15 @@ int main(int argc, char *argv[]) catch (const MuxInitException& except) { etiLog.level(error) << "Multiplex initialisation aborted: " << except.what(); + returnCode = 1; } catch (const std::invalid_argument& except) { etiLog.level(error) << "Caught invalid argument : " << except.what(); + returnCode = 1; } catch (const std::runtime_error& except) { etiLog.level(error) << "Caught runtime error : " << except.what(); + returnCode = 2; } etiLog.log(debug, "exiting...\n"); @@ -500,7 +503,7 @@ int main(int argc, char *argv[]) UdpSocket::clean(); - if (returnCode < 0) { + if (returnCode != 0) { etiLog.log(emerg, "...aborting\n"); } else { etiLog.log(debug, "...done\n"); -- cgit v1.2.3