bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fchmodat, lchmod: port to buggy Linux filesystems


From: Bruno Haible
Subject: Re: [PATCH] fchmodat, lchmod: port to buggy Linux filesystems
Date: Sun, 23 Feb 2020 11:58:45 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

> found that I had trouble reading the code

That's probably because I prefer the "one code for each platform" approach when
suitable - because when debugging problems I don't like to rely to
  $CC ... -E file.c > file.i
to tell me which code is actually enabled -, whereas you seem to prefer a
"global minimum of lines" approach. It's understandable that I find your code
hard to understand and vice versa.

I'm not saying that one is better than the other; just trying to explain why
we find each other's code odd here.

> Instead of making it more complicated still I snipped away everything I 
> couldn't figure out the need for, and installed the attached.
> 
> Perhaps I went too far and some of the complications need to be brought back, 
> but I hope not....

The fchmodat part looks right.

On the other hand, the lchmod part looks wrong: You stripped away the
  test $REPLACE_LCHMOD = 1
case. However, the file doc/glibc-functions/lchmod.texi still says

  Portability problems fixed by Gnulib:
  @itemize
  ...
  @item
  This function always fails with @code{errno} set to @code{ENOSYS},
  even when the file is not a symbolic link:
  GNU/Linux with glibc 2.31.

Overriding the system's lchmod function requires the case REPLACE_LCHMOD=1.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]