[Buildroot] package/coreutils mkfifo -m exit status

Max Filippov jcmvbkbc at gmail.com
Mon Dec 27 07:24:53 UTC 2021


Hi Thomas,

On Sun, Dec 26, 2021 at 3:23 AM Thomas Petazzoni
<thomas.petazzoni at bootlin.com> wrote:
> So, clearly dropping gl_cv_func_fstatat_zero_flag=no from Buildroot's
> coreutils.mk is the right thing to do.

Thanks for the confirmation, I've posted the patch.

> However, I have not been able to understand why
> gl_cv_func_fstatat_zero_flag=no makes fstatat() always return an error.
> The code in lib/fstatat.c is convoluted, and even looking at its Git
> history, I've not been able to spot what happened.

I had to look at the preprocessed source to understand it,
in the presence of gl_cv_func_fstatat_zero_flag=no it looks like this:

int rpl_fstatat(int fd, char const *file , struct stat *st, int flag)
{
 if (flag & ~0x100) {
(*__errno_location ())  =  22; return -1; };

i.e. return error with EINVAL code when flags have anything other
than AT_SYMLINK_NOFOLLOW, which is always the case for the
following call:
https://github.com/coreutils/gnulib/blob/9aca7b67333fd0a90bf56104325ce96199644451/lib/lchmod.c#L65

-- 
Thanks.
-- Max



More information about the buildroot mailing list