diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-02-13 15:41:25 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-02-13 15:46:08 +0100 |
commit | 00ee4b78dbfa569845298c9b2dcc32425196d8d9 (patch) | |
tree | 4e7719005cbc8e23bff6b4f043ceac0f02c87a4c /openbsc | |
parent | 44f04da3799a8fc008cb86969b6bb872dffd57a1 (diff) |
DAHDI: Register every FD in the select() exceptfd-set
This helps us to receive events even if we don't receive or transmit
anything on the line.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/input/dahdi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/input/dahdi.c b/openbsc/src/input/dahdi.c index 1b1c4445c..7890d819f 100644 --- a/openbsc/src/input/dahdi.c +++ b/openbsc/src/input/dahdi.c @@ -334,12 +334,16 @@ static int dahdi_fd_cb(struct bsc_fd *bfd, unsigned int what) switch (e1i_ts->type) { case E1INP_TS_TYPE_SIGN: + if (what & BSC_FD_EXCEPT) + handle_dahdi_exception(e1i_ts); if (what & BSC_FD_READ) rc = handle_ts1_read(bfd); if (what & BSC_FD_WRITE) rc = handle_ts1_write(bfd); break; case E1INP_TS_TYPE_TRAU: + if (what & BSC_FD_EXCEPT) + handle_dahdi_exception(e1i_ts); if (what & BSC_FD_READ) rc = handle_tsX_read(bfd); if (what & BSC_FD_WRITE) @@ -424,7 +428,7 @@ static int dahdi_e1_setup(struct e1inp_line *line) __func__, openstr, strerror(errno)); exit(-1); } - bfd->when = BSC_FD_READ; + bfd->when = BSC_FD_READ | BSC_FD_EXCEPT; dahdi_set_bufinfo(bfd->fd, 1); e1i_ts->driver.dahdi.lapd = lapd_instance_alloc(dahdi_write_msg, bfd); break; @@ -439,7 +443,7 @@ static int dahdi_e1_setup(struct e1inp_line *line) /* We never include the DAHDI B-Channel FD into the * writeset, since it doesn't support poll() based * write flow control */ - bfd->when = BSC_FD_READ;// | BSC_FD_WRITE; + bfd->when = BSC_FD_READ | BSC_FD_EXCEPT;// | BSC_FD_WRITE; break; } |