[PATCH 10/13] tests: fix CPU suckup e1inp_ipa_bts_test after test finish

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/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Thu Aug 23 22:44:59 UTC 2012


From: Pablo Neira Ayuso <pablo at gnumonks.org>

We have to read from the eventfd, otherwise select keeps returning
the file descriptor as ready to read.
---
 tests/e1inp_ipa_bts_test.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/e1inp_ipa_bts_test.c b/tests/e1inp_ipa_bts_test.c
index bf46e9e..1b9a2db 100644
--- a/tests/e1inp_ipa_bts_test.c
+++ b/tests/e1inp_ipa_bts_test.c
@@ -205,9 +205,14 @@ static int abis_nm_sw_act_req(struct e1inp_sign_link *sign_link,
 
 static int test_bts_gsm_12_21_cb(struct osmo_fd *ofd, unsigned int what)
 {
-	int ret;
+	int ret, event_type;
 	struct ipaccess_unit *unit = ofd->data;
 
+	if (read(eventfds[0], &event_type, sizeof(unsigned int)) < 0) {
+		LOGP(DBTSTEST, LOGL_ERROR, "error receiving event\n");
+		return 0;
+	}
+
 	switch(bts_state) {
 	case BTS_TEST_OML_SIGN_LINK_DOWN:
 		/* Do nothing until OML link becomes ready. */
-- 
1.7.10.4





More information about the OpenBSC mailing list