diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/dlt-daemon.c | 6 | ||||
-rw-r--r-- | src/daemon/dlt_daemon_common.c | 8 | ||||
-rw-r--r-- | src/daemon/dlt_daemon_common.h | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index b587ead..b4c82b0 100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -2597,7 +2597,11 @@ int dlt_daemon_process_user_message_unregister_context(DltDaemon *daemon, daemon->ecuid, verbose); - if (context) { + /* In case the daemon is loaded with predefined contexts and its context + * unregisters, the context information will not be deleted from daemon's + * table until its parent application is unregistered. + */ + if (context && context->predefined == false) { /* Delete this connection entry from internal table*/ if (dlt_daemon_context_del(daemon, context, daemon->ecuid, verbose) == -1) { dlt_vlog(LOG_WARNING, diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c index 8508dfe..38b94fe 100644 --- a/src/daemon/dlt_daemon_common.c +++ b/src/daemon/dlt_daemon_common.c @@ -912,6 +912,14 @@ DltDaemonContext *dlt_daemon_context_add(DltDaemon *daemon, context->log_level_pos = log_level_pos; context->user_handle = user_handle; + /* In case a context is loaded from runtime config file, + * the user_handle is 0 and we mark that context as predefined. + */ + if (context->user_handle == 0) + context->predefined = true; + else + context->predefined = false; + /* Sort */ if (new_context) { qsort(user_list->contexts, diff --git a/src/daemon/dlt_daemon_common.h b/src/daemon/dlt_daemon_common.h index be29bca..507098a 100644 --- a/src/daemon/dlt_daemon_common.h +++ b/src/daemon/dlt_daemon_common.h @@ -79,6 +79,7 @@ # include <limits.h> # include <semaphore.h> +# include <stdbool.h> # include "dlt_common.h" # include "dlt_user.h" # include "dlt_offline_logstorage.h" @@ -142,6 +143,7 @@ typedef struct int user_handle; /**< connection handle for connection to user application */ char *context_description; /**< context description */ int8_t storage_log_level; /**< log level set for offline logstorage */ + bool predefined; /**< set to true if this context is predefined by runtime configuration file */ } DltDaemonContext; /* |