From bafb84fe5aefa9bc0f5d6f1e9e942a86bba472bf Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 21 May 2021 16:32:10 +0100 Subject: [PATCH] [Minor] Remove conditional msg_ macro from util.c --- src/libutil/util.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libutil/util.c b/src/libutil/util.c index 49d61e87e..16c8c0f23 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -1059,9 +1059,6 @@ rspamd_file_lock (gint fd, gboolean async) if (async && (errno == EAGAIN || errno == EACCES)) { return FALSE; } - if (errno != ENOTSUP) { - msg_warn ("lock on file failed: %s", strerror (errno)); - } return FALSE; } @@ -1084,9 +1081,6 @@ rspamd_file_unlock (gint fd, gboolean async) return FALSE; } - if (errno != ENOTSUP) { - msg_warn ("unlock on file failed: %s", strerror (errno)); - } return FALSE; } @@ -1924,9 +1918,11 @@ rspamd_file_xopen (const char *fname, int oflags, guint mode, #endif #ifndef HAVE_OCLOEXEC + int serrno; if (fcntl (fd, F_SETFD, FD_CLOEXEC) == -1) { - msg_warn ("fcntl failed: %d, '%s'", errno, strerror (errno)); + serrno = errno; close (fd); + errno = serrno; return -1; } -- 2.39.5