From accd677414bba9adab4ac2e7979695ebea2dc586 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 12 Jan 2020 13:36:56 +0100 Subject: e1d: Don't connect to e1d at program start time Let's not print an error at program/library start time if osmo-e1d cannot be reached. This error is confusing to everyone who may have a libosmo-abis with e1d support compiled in, but who is not (currently) using any lines via this driver, but others drivers. Change-Id: If0d033f8a2ab4f0e72549a811ffccc66b91fb0a8 --- src/input/e1d.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/input/e1d.c b/src/input/e1d.c index 2b67141..c32e330 100644 --- a/src/input/e1d.c +++ b/src/input/e1d.c @@ -186,6 +186,14 @@ e1d_line_update(struct e1inp_line *line) if (line->driver != &e1d_driver) return -EINVAL; + if (!g_e1d) { + /* Connect to daemon */ + g_e1d = osmo_e1dp_client_create(NULL, "/tmp/osmo-e1d.ctl"); + if (!g_e1d) { + LOGPIL(line, DLINP, LOGL_ERROR, "Unable to connect to osmo-e1d daemon\n"); + return -EPIPE; + } + } LOGPIL(line, DLINP, LOGL_NOTICE, "Line update %d %d=E1D(%d:%d) %d\n", line->num, line->port_nr, e1d_intf, e1d_line, line->num_ts); @@ -259,13 +267,6 @@ struct e1inp_driver e1d_driver = { int e1inp_e1d_init(void) { - /* Connect to daemon */ - g_e1d = osmo_e1dp_client_create(NULL, "/tmp/osmo-e1d.ctl"); - if (!g_e1d) { - LOGP(DLINP, LOGL_ERROR, "Unable to connect to osmo-e1d daemon\n"); - return -EPIPE; - } - /* register the driver with the core */ return e1inp_driver_register(&e1d_driver); } -- cgit v1.2.3