Ignore ENOENT error when removing occtl socket file

Silence misleading debug message on server startup since absence
of the socket file is normal and expected.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
This commit is contained in:
Grigory Trenin
2025-11-16 07:54:45 -05:00
parent 284f2ecde5
commit 0017038bcd

View File

@@ -133,9 +133,9 @@ int ctl_handler_init(main_server_st *s)
strlcpy(sa.sun_path, GETPCONFIG(s)->occtl_socket_file,
sizeof(sa.sun_path));
ret = remove(GETPCONFIG(s)->occtl_socket_file);
if (ret != 0) {
if (ret != 0 && errno != ENOENT) {
e = errno;
mslog(s, NULL, LOG_DEBUG, "could not delete socket: '%s': %s",
mslog(s, NULL, LOG_ERR, "could not delete socket: '%s': %s",
GETPCONFIG(s)->occtl_socket_file, strerror(e));
}