dexter has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-abis/+/32401 )
Change subject: e1d: initialize file descriptor numbers to -1 on startup
......................................................................
e1d: initialize file descriptor numbers to -1 on startup
The file descriptor numbers (bfd->fd) are not initialized, this means
they are set to 0 in the beginning. This technically also means that
the file descriptors point to STDIN, which is wrong. Let's use the
line_create callback of driver to initialize them to -1.
Change-Id: I2de8fccad56279748ed9cc035aebf4e2d3935172
---
M src/input/e1d.c
1 file changed, 31 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/01/32401/1
diff --git a/src/input/e1d.c b/src/input/e1d.c
index 01da96d..216575e 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -519,10 +519,27 @@
return 0;
}
+static int e1d_line_create(struct e1inp_line *line)
+{
+ int ts;
+
+ for (ts=1; ts<line->num_ts; ts++)
+ {
+ unsigned int idx = ts-1;
+ struct e1inp_ts *e1i_ts = &line->ts[idx];
+ struct osmo_fd *bfd = &e1i_ts->driver.e1d.fd;
+
+ bfd->fd = -1;
+ }
+
+ return 0;
+}
+
struct e1inp_driver e1d_driver = {
.name = "e1d",
.want_write = e1d_want_write,
.line_update = e1d_line_update,
+ .line_create = e1d_line_create,
};
int e1inp_e1d_init(void)
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-abis/+/32401
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I2de8fccad56279748ed9cc035aebf4e2d3935172
Gerrit-Change-Number: 32401
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange