From ed412acac8e9f8a5745e55adeed9652b34b9ee4f Mon Sep 17 00:00:00 2001 From: Stefan Vacek Date: Mon, 31 Aug 2015 10:13:07 +0200 Subject: Allow multiple instances of dlt-daemon - Make dlt-daemon configurable to specify directory of fifos and port of dlt-daemon, this allows to run multiple instances of dlt-daemon at one node at the same time. This is useful in testing environment where simultanous tests should not interfere due to the same instance of dlt-daemon - dlt-daemon: add option -t to specify a directory where all fifos will be created - dlt-daemon: add option -p to specify the port under which dlt-daemon can be connected - client-library: add environment variable DLT_PIPE_DIR to specify a non-default directory of fifos for logging applications - client-library: add environment variable DLT_DAEMON_TCP_PORT to specify the port under which dlt-daemon can be reached (especially when using dlt-receive) Signed-off-by: Stefan Vacek Signed-off-by: Lutz Helwing --- src/daemon/dlt_daemon_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 2064e94..af97b16 100644 --- a/src/daemon/dlt_daemon_common.c +++ b/src/daemon/dlt_daemon_common.c @@ -390,7 +390,7 @@ DltDaemonApplication* dlt_daemon_application_add(DltDaemon *daemon,char *apid,pi { if ( close(application->user_handle) < 0 ) { - snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE, "close() failed to %s, errno=%d (%s)!\n",filename,errno,strerror(errno)); /* errno 2: ENOENT - No such file or directory */ + snprintf(str,DLT_DAEMON_COMMON_TEXTBUFSIZE, "close() failed to %s/dltpipes/dlt%d, errno=%d (%s)!\n",dltFifoBaseDir,pid,errno,strerror(errno)); /* errno 2: ENOENT - No such file or directory */ dlt_log(LOG_WARNING, str); } @@ -402,7 +402,7 @@ DltDaemonApplication* dlt_daemon_application_add(DltDaemon *daemon,char *apid,pi /* open user pipe only if it is not yet opened */ if (application->user_handle==DLT_FD_INIT && pid!=0) { - snprintf(filename,DLT_DAEMON_COMMON_TEXTBUFSIZE,"%s/dlt%d",DLT_USER_DIR,pid); + snprintf(filename,DLT_DAEMON_COMMON_TEXTBUFSIZE,"%s/dltpipes/dlt%d",dltFifoBaseDir,pid); dlt_user_handle = open(filename, O_WRONLY|O_NONBLOCK); if ( dlt_user_handle < 0 ) -- cgit v1.2.1