Change in osmo-msc[master]: osmo-msc: use stderr to print error messages, not stdout

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Jan 28 21:39:09 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/17040 )

Change subject: osmo-msc: use stderr to print error messages, not stdout
......................................................................

osmo-msc: use stderr to print error messages, not stdout

Change-Id: I702dd054d2e881b526f701ca482ec0f64ba8da28
---
M src/osmo-msc/msc_main.c
1 file changed, 12 insertions(+), 11 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index dc6b684..cf1e504 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -26,6 +26,7 @@
 
 #include <stdbool.h>
 #include <unistd.h>
+#include <stdio.h>
 #include <time.h>
 #include <errno.h>
 #include <signal.h>
@@ -609,20 +610,20 @@
 	msc_network->ctrl = ctrl_interface_setup_dynip(msc_network, ctrl_vty_get_bind_addr(),
 						       OSMO_CTRL_PORT_MSC, NULL);
 	if (!msc_network->ctrl) {
-		printf("Failed to initialize control interface. Exiting.\n");
+		fprintf(stderr, "Failed to initialize control interface. Exiting.\n");
 		return -1;
 	}
 
 #if 0
 TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_install().
 	if (bsc_base_ctrl_cmds_install() != 0) {
-		printf("Failed to initialize the BSC control commands.\n");
+		fprintf(stderr, "Failed to initialize the BSC control commands.\n");
 		return -1;
 	}
 #endif
 
 	if (msc_ctrl_cmds_install(msc_network) != 0) {
-		printf("Failed to initialize the MSC control commands.\n");
+		fprintf(stderr, "Failed to initialize the MSC control commands.\n");
 		return -1;
 	}
 
@@ -632,8 +633,8 @@
 	 * should try to use the nanoseconds part of the current time. */
 
 	if (db_init(msc_cmdline_config.database_name)) {
-		printf("DB: Failed to init database: %s\n",
-		       msc_cmdline_config.database_name);
+		fprintf(stderr, "DB: Failed to init database: %s\n",
+			msc_cmdline_config.database_name);
 		return 4;
 	}
 
@@ -650,7 +651,7 @@
 	}
 
 	if (db_prepare()) {
-		printf("DB: Failed to prepare database.\n");
+		fprintf(stderr, "DB: Failed to prepare database.\n");
 		return 5;
 	}
 
@@ -669,17 +670,17 @@
 			msc_network, &msc_network->mgw.conf);
 
 	if (mgcp_client_connect(msc_network->mgw.client)) {
-		printf("MGCPGW connect failed\n");
+		fprintf(stderr, "MGCPGW connect failed\n");
 		return 7;
 	}
 
 	if (ss7_setup(tall_msc_ctx, &sccp_a, &sccp_iu)) {
-		printf("Setting up SCCP client failed.\n");
+		fprintf(stderr, "Setting up SCCP client failed.\n");
 		return 8;
 	}
 
 	if (sgs_server_open(g_sgs)) {
-		printf("Starting SGs server failed\n");
+		fprintf(stderr, "Starting SGs server failed\n");
 		return 9;
 	}
 
@@ -687,7 +688,7 @@
 					   "OsmoMSC-A", &msc_ran_infra[OSMO_RAT_GERAN_A],
 					   msc_network);
 	if (!msc_network->a.sri) {
-		printf("Setting up A receiver failed\n");
+		fprintf(stderr, "Setting up A receiver failed\n");
 		return 10;
 	}
 	LOGP(DMSC, LOGL_NOTICE, "A-interface: SCCP user %s, cs7-instance %u (%s)\n",
@@ -702,7 +703,7 @@
 					   "OsmoMSC-IuCS", &msc_ran_infra[OSMO_RAT_UTRAN_IU],
 					   msc_network);
 	if (!msc_network->iu.sri) {
-		printf("Setting up IuCS receiver failed\n");
+		fprintf(stderr, "Setting up IuCS receiver failed\n");
 		return 11;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/17040
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I702dd054d2e881b526f701ca482ec0f64ba8da28
Gerrit-Change-Number: 17040
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200128/b2eaee62/attachment.htm>


More information about the gerrit-log mailing list