From: Pablo Neira Ayuso <[email protected]>

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


Reply via email to