summaryrefslogtreecommitdiff
path: root/src/shared/dlt_common.c
diff options
context:
space:
mode:
authorLUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>2020-05-12 20:27:21 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-07-06 10:04:07 +0900
commit54768d5f559aa9b35ab61c20f4f56e1e9409f17a (patch)
tree3ebf52c5e1a536421c907d282589ea1e31104aba /src/shared/dlt_common.c
parent9b3ba69399a92ee3c999959fa75a582879550ad4 (diff)
downloadDLT-daemon-54768d5f559aa9b35ab61c20f4f56e1e9409f17a.tar.gz
common: Isolate FIFO/Unix socket
dlt_common - Add preprocessor DLT_USE_UNIX_SOCKET_IPC for dlt_log_set_fifo_basedir() and dltFifoBaseDir variable - Rename input parameter of dlt_log_set_fifo_basedir() dlt-daemon - Replace setting dltFifoBaseDir by dlt_log_set_fifo_basedir() and add preproc DLT_USE_UNIX_SOCKET_IPC - Update -h opt and flags.loggingFilename based on IPC type Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
Diffstat (limited to 'src/shared/dlt_common.c')
-rw-r--r--src/shared/dlt_common.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index cd71044..eb620f5 100644
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -65,7 +65,10 @@
const char dltSerialHeader[DLT_ID_SIZE] = { 'D', 'L', 'S', 1 };
char dltSerialHeaderChar[DLT_ID_SIZE] = { 'D', 'L', 'S', 1 };
+
+#ifndef DLT_USE_UNIX_SOCKET_IPC
char dltFifoBaseDir[DLT_PATH_MAX] = "/tmp";
+#endif
#ifdef DLT_SHM_ENABLE
char dltShmName[NAME_MAX + 1] = "/dlt-shm";
@@ -1726,11 +1729,13 @@ void dlt_log_set_filename(const char *filename)
logging_filename[NAME_MAX] = 0;
}
-void dlt_log_set_fifo_basedir(const char *env_pipe_dir)
+#ifndef DLT_USE_UNIX_SOCKET_IPC
+void dlt_log_set_fifo_basedir(const char *pipe_dir)
{
- strncpy(dltFifoBaseDir, env_pipe_dir, DLT_PATH_MAX);
+ strncpy(dltFifoBaseDir, pipe_dir, DLT_PATH_MAX);
dltFifoBaseDir[DLT_PATH_MAX - 1] = 0;
}
+#endif
#ifdef DLT_SHM_ENABLE
void dlt_log_set_shm_name(const char * env_shm_name)
@@ -3795,13 +3800,14 @@ void dlt_check_envvar()
dlt_log_init(mode);
}
+#ifndef DLT_USE_UNIX_SOCKET_IPC
char *env_pipe_dir = getenv("DLT_PIPE_DIR");
if (env_pipe_dir != NULL)
dlt_log_set_fifo_basedir(env_pipe_dir);
else
dlt_log_set_fifo_basedir(DLT_USER_IPC_PATH);
-
+#endif
#ifdef DLT_SHM_ENABLE
char* env_shm_name = getenv("DLT_SHM_NAME");