diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2023-04-20 17:03:01 +0200 |
---|---|---|
committer | dexter <pmaier@sysmocom.de> | 2023-05-02 13:00:00 +0000 |
commit | a7e76216901e912aae58f9a7e8f1748709d6c107 (patch) | |
tree | d536014535bc1826085f32be096bab3247c810fd | |
parent | trau_pcu_ericsson: set uplink frame error bit correctly (diff) | |
download | libosmo-abis-a7e76216901e912aae58f9a7e8f1748709d6c107.tar.xz libosmo-abis-a7e76216901e912aae58f9a7e8f1748709d6c107.zip |
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
-rw-r--r-- | src/input/e1d.c | 8 |
1 files changed, 4 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 @@ static int e1d_line_update(struct e1inp_line *line) } 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 @@ static int e1d_line_update(struct e1inp_line *line) /* 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 @@ static int e1d_line_update(struct e1inp_line *line) /* 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, |