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-7-alobakin@pm.me>
Date: Sun, 27 Dec 2020 18:41:32 +0000
From: Alexander Lobakin <alobakin@...me>
To: Rich Felker <dalias@...ifal.cx>, musl@...ts.openwall.com
Cc: Alexander Lobakin <alobakin@...me>
Subject: [PATCH 07/18] timer_settime: 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/time/timer_settime.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/time/timer_settime.c b/src/time/timer_settime.c
index 373f00ced7f2..9a576cd55fbe 100644
--- a/src/time/timer_settime.c
+++ b/src/time/timer_settime.c
@@ -13,11 +13,8 @@ int timer_settime(timer_t t, int flags, const struct itimerspec *restrict val, s
 #ifdef SYS_timer_settime64
 	time_t is = val->it_interval.tv_sec, vs = val->it_value.tv_sec;
 	long ins = val->it_interval.tv_nsec, vns = val->it_value.tv_nsec;
-	int r = -ENOSYS;
-	if (SYS_timer_settime == SYS_timer_settime64
-	    || !IS32BIT(is) || !IS32BIT(vs) || (sizeof(time_t)>4 && old))
-		r = __syscall(SYS_timer_settime64, t, flags,
-			((long long[]){is, ins, vs, vns}), old);
+	int r = __syscall(SYS_timer_settime64, t, flags,
+		((long long[]){is, ins, vs, vns}), old);
 	if (SYS_timer_settime == SYS_timer_settime64 || r!=-ENOSYS)
 		return __syscall_ret(r);
 	if (!IS32BIT(is) || !IS32BIT(vs))
-- 
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.