Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201227184032.22413-14-alobakin@pm.me>
Date: Sun, 27 Dec 2020 18:42:25 +0000
From: Alexander Lobakin <alobakin@...me>
To: Rich Felker <dalias@...ifal.cx>, musl@...ts.openwall.com
Cc: Alexander Lobakin <alobakin@...me>
Subject: [PATCH 14/18] mq_timedreceive: prefer time64 variant if available

Instead of using time64 variant "only when needed", use it as
a default and fallback to time32 only on -ENOSYS.

Signed-off-by: Alexander Lobakin <alobakin@...me>
---
 src/mq/mq_timedreceive.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mq/mq_timedreceive.c b/src/mq/mq_timedreceive.c
index f41b6642f822..f43de195de3f 100644
--- a/src/mq/mq_timedreceive.c
+++ b/src/mq/mq_timedreceive.c
@@ -10,10 +10,8 @@ ssize_t mq_timedreceive(mqd_t mqd, char *restrict msg, size_t len, unsigned *res
 #ifdef SYS_mq_timedreceive_time64
 	time_t s = at ? at->tv_sec : 0;
 	long ns = at ? at->tv_nsec : 0;
-	long r = -ENOSYS;
-	if (SYS_mq_timedreceive == SYS_mq_timedreceive_time64 || !IS32BIT(s))
-		r = __syscall_cp(SYS_mq_timedreceive_time64, mqd, msg, len, prio,
-			at ? ((long long []){at->tv_sec, at->tv_nsec}) : 0);
+	long r = __syscall_cp(SYS_mq_timedreceive_time64, mqd, msg, len, prio,
+		at ? ((long long []){at->tv_sec, at->tv_nsec}) : 0);
 	if (SYS_mq_timedreceive == SYS_mq_timedreceive_time64 || r != -ENOSYS)
 		return __syscall_ret(r);
 	return syscall_cp(SYS_mq_timedreceive, mqd, msg, len, prio,
-- 
2.29.2


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.