aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-08-23 13:51:27 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2012-08-30 21:50:32 +0200
commit7723b4e9a3fd51cec28fb48423472479cd41d95e (patch)
tree1340c79a7801cdc47f15f97ae1ab52d71c154a4d
parent953060001d2cb6ef86f432a79599da2951780ef7 (diff)
tests: fix CPU suckup e1inp_ipa_bts_test after test finish
We have to read from the eventfd, otherwise select keeps returning the file descriptor as ready to read.
-rw-r--r--tests/e1inp_ipa_bts_test.c7
1 files changed, 6 insertions, 1 deletions
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. */