From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 538 invoked from network); 27 Dec 2020 18:56:50 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Dec 2020 18:56:50 -0000 Received: (qmail 23552 invoked by uid 550); 27 Dec 2020 18:56:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 5760 invoked from network); 27 Dec 2020 18:42:16 -0000 Date: Sun, 27 Dec 2020 18:41:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1609094524; bh=Ku0at8kEgeqGBvm9Z/xoKXj8g/m9BfzP1UW74uD0fq0=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=pPUXeNwa6pg1ALO2o/D8wRKDVc6MOHGTZdPmEJgXfh58hlsHbB9ocvDnpb4kgBr/J Cd0NKYCl7A76aEfCvGFVkq99PJzcEHNoTNuII4qX89cg/mFW6btOKW/B60B6mVXtyh XXQZ09tORVc10tHck/rIxiyy9JtSnQesoyQ3VwNlD/PDesHLDMLCQWzDPbfUZGmbyI Jba+brpbsbs978ozQk2eHS38xKIgMcsErCFNDsInS0cBDvox+I+CNh8cNaPzfDOThL yK2hFrx68avIfOGTz56foVT+WvvxRk2OSh5hWR6vMg2OeqtU7vqE12B7GrhZyCrZpo DySjwoIvql/Aw== To: Rich Felker , musl@lists.openwall.com From: Alexander Lobakin Cc: Alexander Lobakin Message-ID: <20201227184032.22413-10-alobakin@pm.me> In-Reply-To: <20201227184032.22413-1-alobakin@pm.me> References: <20201227183842.22030-1-alobakin@pm.me> <20201227184032.22413-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [musl] [PATCH 10/18] utimensat: 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 --- src/stat/utimensat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/stat/utimensat.c b/src/stat/utimensat.c index 730723a9ea70..e3fda06faa01 100644 --- a/src/stat/utimensat.c +++ b/src/stat/utimensat.c @@ -13,7 +13,6 @@ int utimensat(int fd, const char *path, const struct time= spec times[2], int flag =09if (times && times[0].tv_nsec=3D=3DUTIME_NOW && times[1].tv_nsec=3D=3DU= TIME_NOW) =09=09times =3D 0; #ifdef SYS_utimensat_time64 -=09r =3D -ENOSYS; =09time_t s0=3D0, s1=3D0; =09long ns0=3D0, ns1=3D0; =09if (times) { @@ -22,9 +21,8 @@ int utimensat(int fd, const char *path, const struct time= spec times[2], int flag =09=09if (!NS_SPECIAL(ns0)) s0 =3D times[0].tv_sec; =09=09if (!NS_SPECIAL(ns1)) s1 =3D times[1].tv_sec; =09} -=09if (SYS_utimensat =3D=3D SYS_utimensat_time64 || !IS32BIT(s0) || !IS32B= IT(s1)) -=09=09r =3D __syscall(SYS_utimensat_time64, fd, path, times ? -=09=09=09((long long[]){s0, ns0, s1, ns1}) : 0, flags); +=09r =3D __syscall(SYS_utimensat_time64, fd, path, times ? +=09=09((long long[]){s0, ns0, s1, ns1}) : 0, flags); =09if (SYS_utimensat =3D=3D SYS_utimensat_time64 || r!=3D-ENOSYS) =09=09return __syscall_ret(r); =09if (!IS32BIT(s0) || !IS32BIT(s1)) --=20 2.29.2