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

diff --git a/src/signal/sigtimedwait.c b/src/signal/sigtimedwait.c
index 1287174ebafd..603ba912f78f 100644
--- a/src/signal/sigtimedwait.c
+++ b/src/signal/sigtimedwait.c
@@ -10,10 +10,8 @@ static int do_sigtimedwait(const sigset_t *restrict mask, siginfo_t *restrict si
 #ifdef SYS_rt_sigtimedwait_time64
 	time_t s = ts ? ts->tv_sec : 0;
 	long ns = ts ? ts->tv_nsec : 0;
-	int r = -ENOSYS;
-	if (SYS_rt_sigtimedwait == SYS_rt_sigtimedwait_time64 || !IS32BIT(s))
-		r = __syscall_cp(SYS_rt_sigtimedwait_time64, mask, si,
-			ts ? ((long long[]){s, ns}) : 0, _NSIG/8);
+	int r = __syscall_cp(SYS_rt_sigtimedwait_time64, mask, si,
+		ts ? ((long long[]){s, ns}) : 0, _NSIG/8);
 	if (SYS_rt_sigtimedwait == SYS_rt_sigtimedwait_time64 || r!=-ENOSYS)
 		return r;
 	return __syscall_cp(SYS_rt_sigtimedwait, mask, si,
-- 
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.