diff options
author | Harald Welte <laforge@osmocom.org> | 2020-06-29 07:46:07 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-06-29 22:12:42 +0200 |
commit | 8a9392ff44563c40a163d145d13969e99344db0f (patch) | |
tree | 47041cd54e28cbe0b362a9192811284baaf196ba | |
parent | b3414ed4cccb9b15cb48a5d9aa6c52c9e8d9c3fa (diff) |
ctl.c: Fix off-by-one: FD=0 is a valid file descriptor
It is possible that fd=0 (stdin) is closed in a daemon scenario, and
subsequently fd=0 is reused for other files/sockets.
Change-Id: Id8279f04373e891009224bab34a4d1d886520fea
-rw-r--r-- | src/ctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -96,7 +96,7 @@ _e1d_ts_stop(struct e1_ts *ts) { ts->mode = E1_TS_MODE_OFF; - if (ts->fd > 0) { + if (ts->fd >= 0) { close(ts->fd); ts->fd = -1; } |