dexter submitted this change.
e1d: do not set fd number to 0 after close
0 is reserved for STDIN, so lets not set the file descriptor to 0 after
we close it. Lets use -1 instead.
Change-Id: I72e4775135caf4e3727c4f0654a545478c73bb83
Related: OS#5983
---
M src/input/e1d.c
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/input/e1d.c b/src/input/e1d.c
index 44a710d..01da96d 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -429,13 +429,13 @@
}
if (bfd->fd) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
continue;
case E1INP_TS_TYPE_SIGN:
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
@@ -465,7 +465,7 @@
/* close, if old timeslot mode doesn't match new config */
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
@@ -489,7 +489,7 @@
/* close, if old timeslot mode doesn't match new config */
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_RAW) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
To view, visit change 32392. To unsubscribe, or for help writing mail filters, visit settings.