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

diff --git a/src/time/clock_settime.c b/src/time/clock_settime.c
index 1004ed152846..b6dbef04fad1 100644
--- a/src/time/clock_settime.c
+++ b/src/time/clock_settime.c
@@ -9,10 +9,8 @@ int clock_settime(clockid_t clk, const struct timespec *ts)
 #ifdef SYS_clock_settime64
 	time_t s = ts->tv_sec;
 	long ns = ts->tv_nsec;
-	int r = -ENOSYS;
-	if (SYS_clock_settime == SYS_clock_settime64 || !IS32BIT(s))
-		r = __syscall(SYS_clock_settime64, clk,
-			((long long[]){s, ns}));
+	int r = __syscall(SYS_clock_settime64, clk,
+		((long long[]){s, ns}));
 	if (SYS_clock_settime == SYS_clock_settime64 || r!=-ENOSYS)
 		return __syscall_ret(r);
 	if (!IS32BIT(s))
-- 
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.