From 2410feca37f44b4cc8255cce61e728679ac2c41a Mon Sep 17 00:00:00 2001 From: Yusuke Sato Date: Wed, 23 May 2018 22:43:12 +0900 Subject: dlt-daemon: Avoid to output duplicated application registration message (#63) If application tries to send application registration request before dlt-daemon startup, the request is sent twice as below: 1. Buffered request in user library buffer 2. New request when user app succeeds to attach to dlt-daemon In previous, dlt-daemon had been output the registration messages 2 times even though these messages were come from same application. This duplicated output is avoided by this change. Warning message in case of dlt-runtime-context.cfg exists is also avoided. This file is created when Control message: "Store Config" is used. This is not irregular case. Signed-off-by: Yusuke Sato --- src/daemon/dlt_daemon_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/daemon/dlt_daemon_common.c') diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c index 78bdb56..73cd1d8 100644 --- a/src/daemon/dlt_daemon_common.c +++ b/src/daemon/dlt_daemon_common.c @@ -357,7 +357,7 @@ DltDaemonApplication* dlt_daemon_application_add(DltDaemon *daemon, char *apid, new_application = 1; - } else if (pid != application->pid) { + } else if ((pid != application->pid) && (application->pid != 0)) { snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE, "Duplicate registration of ApplicationID: '%.4s'; registering from PID %d, existing from PID %d\n",apid, pid, application->pid); dlt_log(LOG_WARNING, str); -- cgit v1.2.1