|
|
Message-ID: <20201227184032.22413-13-alobakin@pm.me>
Date: Sun, 27 Dec 2020 18:42:17 +0000
From: Alexander Lobakin <alobakin@...me>
To: Rich Felker <dalias@...ifal.cx>, musl@...ts.openwall.com
Cc: Alexander Lobakin <alobakin@...me>
Subject: [PATCH 13/18] mq_timedsend: 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_timedsend.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/mq/mq_timedsend.c b/src/mq/mq_timedsend.c
index 56cfcbb833ed..f85d9f7dd07a 100644
--- a/src/mq/mq_timedsend.c
+++ b/src/mq/mq_timedsend.c
@@ -10,10 +10,8 @@ int mq_timedsend(mqd_t mqd, const char *msg, size_t len, unsigned prio, const st
#ifdef SYS_mq_timedsend_time64
time_t s = at ? at->tv_sec : 0;
long ns = at ? at->tv_nsec : 0;
- long r = -ENOSYS;
- if (SYS_mq_timedsend == SYS_mq_timedsend_time64 || !IS32BIT(s))
- r = __syscall_cp(SYS_mq_timedsend_time64, mqd, msg, len, prio,
- at ? ((long long []){at->tv_sec, at->tv_nsec}) : 0);
+ long r = __syscall_cp(SYS_mq_timedsend_time64, mqd, msg, len, prio,
+ at ? ((long long []){at->tv_sec, at->tv_nsec}) : 0);
if (SYS_mq_timedsend == SYS_mq_timedsend_time64 || r != -ENOSYS)
return __syscall_ret(r);
return syscall_cp(SYS_mq_timedsend, 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.