Change in osmo-bsc[master]: Meas Tools: Avoid messing up the terminal with error on osmo_sock_init

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/.

keith gerrit-no-reply at lists.osmocom.org
Sat Mar 28 00:57:45 UTC 2020


keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/17648 )


Change subject: Meas Tools: Avoid messing up the terminal with error on osmo_sock_init
......................................................................

Meas Tools: Avoid messing up the terminal with error on osmo_sock_init

Let's try to bind the socket before we call initCDKScreen()
so we don't end up with a messed up terminal if the socket call
fails.

Change-Id: Ia5148d9ef386df314bc2837b3cb672150250bd2a
---
M src/utils/meas_vis.c
1 file changed, 4 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/17648/1

diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c
index 686cfb9..1cbafcf 100644
--- a/src/utils/meas_vis.c
+++ b/src/utils/meas_vis.c
@@ -290,6 +290,10 @@
 
 	printf("sizeof(gsm_meas_rep)=%u\n", sizeof(struct gsm_meas_rep));
 	printf("sizeof(meas_feed_meas)=%u\n", sizeof(struct meas_feed_meas));
+	g_st.udp_ofd.cb = udp_fd_cb;
+	rc =  osmo_sock_init_ofd(&g_st.udp_ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 8888, OSMO_SOCK_F_BIND);
+	if (rc < 0)
+		exit(1);
 
 	INIT_LLIST_HEAD(&g_st.ms_list);
 	g_st.curses_win = initscr();
@@ -318,11 +322,6 @@
 	exit(0);
 #endif
 
-	g_st.udp_ofd.cb = udp_fd_cb;
-	rc =  osmo_sock_init_ofd(&g_st.udp_ofd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 8888, OSMO_SOCK_F_BIND);
-	if (rc < 0)
-		exit(1);
-
 	while (1) {
 		osmo_select_main(0);
 		update_sliders();

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia5148d9ef386df314bc2837b3cb672150250bd2a
Gerrit-Change-Number: 17648
Gerrit-PatchSet: 1
Gerrit-Owner: keith <keith at rhizomatica.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200328/6d8c21f1/attachment.htm>


More information about the gerrit-log mailing list