commit bafb84f: [Minor] Remove conditional msg_ macro from util.c

Vsevolod Stakhov vsevolod at highsecure.ru
Fri May 21 15:35:13 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-05-21 16:32:10 +0100
URL: https://github.com/rspamd/rspamd/commit/bafb84fe5aefa9bc0f5d6f1e9e942a86bba472bf (HEAD -> master)

[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;
 	}


More information about the Commits mailing list