diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-04-15 16:25:40 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-04-15 16:25:40 +0200 |
commit | 6004a007c5bd51b95df2ade94d8e67a635369f36 (patch) | |
tree | ab46df42197c04bf31be1279a2bb4e1ced0049ff | |
parent | 47cedcafa6302b8019bea46e3a529c2790705bd1 (diff) | |
download | dabmux-6004a007c5bd51b95df2ade94d8e67a635369f36.tar.gz dabmux-6004a007c5bd51b95df2ade94d8e67a635369f36.tar.bz2 dabmux-6004a007c5bd51b95df2ade94d8e67a635369f36.zip |
Set program return codes
-rw-r--r-- | src/DabMux.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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"); |