diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 09f716a..2f4d612 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -166,6 +166,11 @@ int main(int argc, char **argv) /* Last cleaning tasks */ exit: + /* If called with -h, cfg won't be initialised, so we must check if + * cfg is NULL */ + if (cfg && VERBOSE_CHATTERBOX) + fprintf(stderr, "%s: exiting.\n", program_name) ; + if (sockfd >= 0) close(sockfd) ; // Close socket free_request_list() ; @@ -175,7 +180,6 @@ int main(int argc, char **argv) sem_destroy(&lock_requests) ; sem_destroy(&lock_aps) ; - fprintf(stderr, "%s: end.\n", program_name) ; return ret ; } diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index 33a767d..9bfd908 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -275,11 +275,19 @@ int main(int argc, char *argv[]) /* Last cleaning tasks */ exit: +#ifdef OWLPS_LISTENER_USES_CONFIG_FILE + /* If called with -h, cfg won't be initialised, so we must check if + * cfg is NULL */ + if (cfg && VERBOSE_CHATTERBOX) +#else // OWLPS_LISTENER_USES_CONFIG_FILE + if (VERBOSE_CHATTERBOX) +#endif // OWLPS_LISTENER_USES_CONFIG_FILE + fprintf(stderr, "%s: exiting.\n", program_name) ; + #ifdef OWLPS_LISTENER_USES_CONFIG_FILE cfg_free(cfg) ; // Clean configuration #endif // OWLPS_LISTENER_USES_CONFIG_FILE - printf("%s: end.\n", program_name) ; return ret ; } diff --git a/owlps-positioner/src/owlps-positionerd.cc b/owlps-positioner/src/owlps-positionerd.cc index 344ac76..7d8a348 100644 --- a/owlps-positioner/src/owlps-positionerd.cc +++ b/owlps-positioner/src/owlps-positionerd.cc @@ -18,6 +18,7 @@ #include "userinterface.hh" +#include "configuration.hh" #include "inputdatareader.hh" #include "stock.hh" #include "positioning.hh" @@ -59,6 +60,8 @@ int main(int argc, char **argv) Stock::clear() ; } - cerr << argv[0] << ": end." << endl ; + if (Configuration::is_configured("verbose")) + cerr << argv[0] << ": exiting." << endl ; + return 0 ; } diff --git a/owlps-udp-to-http/owlps-udp-to-http.c b/owlps-udp-to-http/owlps-udp-to-http.c index ce76212..652ca40 100644 --- a/owlps-udp-to-http/owlps-udp-to-http.c +++ b/owlps-udp-to-http/owlps-udp-to-http.c @@ -158,7 +158,9 @@ int main(int argc, char *argv[]) free_results_list() ; sem_destroy(&lock_results) ; - printf("%s: end.\n", program_name) ; + if (verbose) + fprintf(stderr, "%s: exiting.\n", program_name) ; + return ret ; }