Hi Grisha, Grisha Levit <grishale...@gmail.com> writes:
> * src/touch.c (touch): Do not use open_errno == EEXIST for diagnostic > if file was a directory as macOS 26 sets it for open("/", O_CREAT, ...). > --- > src/touch.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > Fixes: > > FAIL tests/touch/not-owner.sh > > + diff -u exp out > --- exp 2025-09-18 16:28:32.548385670 -0400 > +++ out 2025-09-18 16:28:32.527841543 -0400 > @@ -1 +1 @@ > -touch: setting times of '/': Read-only file system > +touch: cannot touch '/': File exists > > diff --git a/src/touch.c b/src/touch.c > index bc6b23840..cbe0cba38 100644 > --- a/src/touch.c > +++ b/src/touch.c > @@ -180,11 +180,12 @@ touch (char const *file) > would give a bogus diagnostic for e.g., 'touch /' (assuming we > don't own / or have write access). On Solaris 10 and probably > other systems, opening a directory like "." fails with EINVAL. > - (On SunOS 4 it was EPERM but that's obsolete.) */ > + (On SunOS 4 it was EPERM but that's obsolete.) On macOS 26 > + opening "/" fails with EEXIST. */ > struct stat st; > if (open_errno > && ! (open_errno == EISDIR > - || (open_errno == EINVAL > + || ((open_errno == EINVAL || open_errno == EEXIST) > && stat (file, &st) == 0 && S_ISDIR (st.st_mode)))) > { > /* The wording of this diagnostic should cover at least two cases: Thank you for the patch. Your MacOS testing is very helpful since we only can test it using CI machines and a MacOS 12 system from the cfarm [1]. This patch looks fine to me, but I'm curious if it or other errno's messed with by Gnulib should be updated for MacOS 26. I'm adding Bruno to CC. Do you think we can add a MacOS 26 runner to the CI for Gnulib and Coreutils? It looks like it entered public preview a week ago, and as far as I can tell it isn't limited to GitHub Enterprise customers [2]. Assuming the open and openat tests pass, then I think this patch should be okay to apply. Collin [1] https://portal.cfarm.net/ [2] https://github.blog/changelog/2025-09-11-actions-macos-26-image-now-in-public-preview/