diff options
author | S. Hameed <shameed@jp.adit-jv.com> | 2016-02-18 18:42:15 +0900 |
---|---|---|
committer | Gernot Wirschal <gernot.wirschal@bmw.de> | 2016-04-28 15:00:30 +0200 |
commit | 0ee4099f8a6782f399af31f4b1996c19b23b22cb (patch) | |
tree | 94c659120bf7d820842dafd09256721bcd1e6a71 /src/console/dlt-control.c | |
parent | a3dd0b954e8f020d535afb2c9e315cc33fea681e (diff) | |
download | DLT-daemon-0ee4099f8a6782f399af31f4b1996c19b23b22cb.tar.gz |
CommonControl: Fix for commands not working with unix socket
This commit resloves a bug introduced from the commit:
CommonControl: Unix socket path and ecuid parsing for control applications
Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
Change-Id: Ifd4af24cab3ef41fda86fdf63a559438b51eca6e
Diffstat (limited to 'src/console/dlt-control.c')
-rw-r--r-- | src/console/dlt-control.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/console/dlt-control.c b/src/console/dlt-control.c index b4808eb..8a66d0a 100644 --- a/src/console/dlt-control.c +++ b/src/console/dlt-control.c @@ -63,6 +63,7 @@ #include "dlt_client.h" #include "dlt_user.h" +#include "dlt-control-common.h" #define DLT_RECEIVE_TEXTBUFSIZE 10024 /* Size of buffer for text output */ @@ -460,7 +461,8 @@ int main(int argc, char* argv[]) else if (dltdata.yflag == DLT_CLIENT_MODE_UNIX) { g_dltclient.mode = DLT_CLIENT_MODE_UNIX; - g_dltclient.socketPath = dlt_parse_config_param("ControlSocketPath"); + g_dltclient.socketPath = NULL; + dlt_parse_config_param("ControlSocketPath", &g_dltclient.socketPath); } else { @@ -514,9 +516,17 @@ int main(int argc, char* argv[]) } else { - dltdata.evalue = dlt_parse_config_param("ECUId"); - dlt_set_id(dltdata.ecuid,dltdata.evalue); - dlt_set_id(g_dltclient.ecuid,dltdata.evalue); + dltdata.evalue = NULL; + if (dlt_parse_config_param("ECUId", &dltdata.evalue) == 0) + { + dlt_set_id(dltdata.ecuid,dltdata.evalue); + dlt_set_id(g_dltclient.ecuid,dltdata.evalue); + free (dltdata.evalue); + } + else + { + fprintf(stderr, "ERROR: Failed to read ECUId from dlt.conf \n"); + } } /* Connect to TCP socket or open serial device */ @@ -684,6 +694,9 @@ int main(int argc, char* argv[]) dlt_client_cleanup(&g_dltclient,dltdata.vflag); } + if (g_dltclient.socketPath != NULL) + free(g_dltclient.socketPath); + dlt_file_free(&(dltdata.file),dltdata.vflag); dlt_filter_free(&(dltdata.filter),dltdata.vflag); |