Bruno Haible <br...@clisp.org> writes: > 2) In the configure-time test in m4/utimensat.m4, you added > result |= 128; > However, the exit code of a program is limited to the range 0..127. > How to merge some of the bits? So far, this test fails with exit code > - 2 on AIX, > - 64 on macOS, NetBSD, DragonFly BSD, > - 66 on Haiku. > I would therefore replace the bit masks as follows: > - 8, 16, 32 -> 8 > - 64 -> 16 > - 128 -> 32
Oops, right. I forgot about that. Fixed using your suggestions. Collin
>From 579debda823f8066f870c7e7fac65a4229db5f21 Mon Sep 17 00:00:00 2001 From: Collin Funk <collin.fu...@gmail.com> Date: Tue, 18 Mar 2025 18:12:39 -0700 Subject: [PATCH] utimensat: Make sure exit status in configure check doesn't exceed 127. Reported by Bruno Haible in <https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00061.html>. * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Merge bits for tests to match expectations on current platforms. --- ChangeLog | 8 ++++++++ m4/utimensat.m4 | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca5aa4b676..7a5c6632d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-03-18 Collin Funk <collin.fu...@gmail.com> + + utimensat: Make sure exit status in configure check doesn't exceed 127. + Reported by Bruno Haible in + <https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00061.html>. + * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Merge bits for tests to match + expectations on current platforms. + 2025-03-17 Collin Funk <collin.fu...@gmail.com> utimensat: Increment serial number for previous commit. diff --git a/m4/utimensat.m4 b/m4/utimensat.m4 index 17caea5f68..d017af37b2 100644 --- a/m4/utimensat.m4 +++ b/m4/utimensat.m4 @@ -1,5 +1,5 @@ # utimensat.m4 -# serial 13 +# serial 14 dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -67,11 +67,11 @@ AC_DEFUN([gl_FUNC_UTIMENSAT] ts[1].tv_sec = 1; ts[1].tv_nsec = UTIME_OMIT; if (utimensat (AT_FDCWD, f, ts, 0)) - result |= 16; + result |= 8; if (stat (f, &st)) - result |= 32; + result |= 8; else if (st.st_ctime < st.st_atime) - result |= 64; + result |= 16; } enum { @@ -90,7 +90,7 @@ AC_DEFUN([gl_FUNC_UTIMENSAT] ts[1].tv_sec = 1; ts[1].tv_nsec = 0; if (utimensat (AT_FDCWD, f, ts, 0) == 0) - result |= 128; + result |= 32; } return result; ]])], -- 2.48.1