Skip to content

Commit

Permalink
daemon: unix socket checking before creating new
Browse files Browse the repository at this point in the history
+ unix socket used for unittesting (gateway)
+ unix socket spamming removed

Signed-off-by: LUU QUANG MINH <[email protected]>
  • Loading branch information
LUU QUANG MINH authored and LUU QUANG MINH committed Jun 27, 2024
1 parent 8fc4e8e commit 0c44b2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ if(WITH_GIT_SUBMODULE)
endif()

if(WITH_DLT_UNIT_TESTS)
set(DLT_IPC "UNIX_SOCKET")
find_package(GTest)
if(GTEST_FOUND)
find_package(PkgConfig REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/dlt_daemon_unix_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int dlt_daemon_unix_socket_open(int *sock, char *sock_path, int type, int mask)
addr.sun_family = AF_UNIX;
memcpy(addr.sun_path, sock_path, sizeof(addr.sun_path));

if (unlink(sock_path) != 0) {
if(unlink(sock_path) != 0 && (errno != ENOENT)) {
dlt_vlog(LOG_WARNING, "%s: unlink() failed: %s\n",
__func__, strerror(errno));
}
Expand Down

0 comments on commit 0c44b2f

Please sign in to comment.