Skip to content

Commit 0c44b2f

Browse files
daemon: unix socket checking before creating new
+ unix socket used for unittesting (gateway) + unix socket spamming removed Signed-off-by: LUU QUANG MINH <Minh.LuuQuang@vn.bosch.com>
1 parent 8fc4e8e commit 0c44b2f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ if(WITH_GIT_SUBMODULE)
380380
endif()
381381

382382
if(WITH_DLT_UNIT_TESTS)
383+
set(DLT_IPC "UNIX_SOCKET")
383384
find_package(GTest)
384385
if(GTEST_FOUND)
385386
find_package(PkgConfig REQUIRED)

src/daemon/dlt_daemon_unix_socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int dlt_daemon_unix_socket_open(int *sock, char *sock_path, int type, int mask)
145145
addr.sun_family = AF_UNIX;
146146
memcpy(addr.sun_path, sock_path, sizeof(addr.sun_path));
147147

148-
if (unlink(sock_path) != 0) {
148+
if(unlink(sock_path) != 0 && (errno != ENOENT)) {
149149
dlt_vlog(LOG_WARNING, "%s: unlink() failed: %s\n",
150150
__func__, strerror(errno));
151151
}

0 commit comments

Comments
 (0)