summaryrefslogtreecommitdiffstats
path: root/src/DabMux.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-15 16:25:40 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-15 16:25:40 +0200
commit6004a007c5bd51b95df2ade94d8e67a635369f36 (patch)
treeab46df42197c04bf31be1279a2bb4e1ced0049ff /src/DabMux.cpp
parent47cedcafa6302b8019bea46e3a529c2790705bd1 (diff)
downloaddabmux-6004a007c5bd51b95df2ade94d8e67a635369f36.tar.gz
dabmux-6004a007c5bd51b95df2ade94d8e67a635369f36.tar.bz2
dabmux-6004a007c5bd51b95df2ade94d8e67a635369f36.zip
Set program return codes
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r--src/DabMux.cpp5
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");