dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-abis/+/32392 )


Change subject: e1d: do not set fd number to 0 after close
......................................................................

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
---
M src/input/e1d.c
1 file changed, 16 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/92/32392/1

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 https://gerrit.osmocom.org/c/libosmo-abis/+/32392
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I72e4775135caf4e3727c4f0654a545478c73bb83
Gerrit-Change-Number: 32392
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-MessageType: newchange

Reply via email to