Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 27 Dec 2020 18:41:47 +0000
From: Alexander Lobakin <alobakin@...me>
To: Rich Felker <dalias@...ifal.cx>, musl@...ts.openwall.com
Cc: Alexander Lobakin <alobakin@...me>
Subject: [PATCH 09/18] timerfd_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/linux/timerfd.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/linux/timerfd.c b/src/linux/timerfd.c
index d26371cc1182..bfaae1daf675 100644
--- a/src/linux/timerfd.c
+++ b/src/linux/timerfd.c
@@ -14,11 +14,8 @@ int timerfd_settime(int fd, int flags, const struct itimerspec *new, struct itim
 #ifdef SYS_timerfd_settime64
 	time_t is = new->it_interval.tv_sec, vs = new->it_value.tv_sec;
 	long ins = new->it_interval.tv_nsec, vns = new->it_value.tv_nsec;
-	int r = -ENOSYS;
-	if (SYS_timerfd_settime == SYS_timerfd_settime64
-	    || !IS32BIT(is) || !IS32BIT(vs) || (sizeof(time_t)>4 && old))
-		r = __syscall(SYS_timerfd_settime64, fd, flags,
-			((long long[]){is, ins, vs, vns}), old);
+	int r = __syscall(SYS_timerfd_settime64, fd, flags,
+		((long long[]){is, ins, vs, vns}), old);
 	if (SYS_timerfd_settime == SYS_timerfd_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.