unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <syq@debian.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org, Xi Ruoyao <xry111@mengyan1223.wang>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH] MIPS: Setup errno for {f,l,}xstat
Date: Tue, 7 Sep 2021 21:20:19 +0800	[thread overview]
Message-ID: <CAKcpw6Uuw7+sF2agtU_uaDnc-6jD+aEp5E8tdKE0OqnzX6NHeQ@mail.gmail.com> (raw)
In-Reply-To: <43d37c1b-6efc-c688-cc4a-f6514ff3c6b8@linaro.org>

Adhemerval Zanella <adhemerval.zanella@linaro.org> 于 2021年9月7日周二 下午9:15写道:

>
>
> On 07/09/2021 02:31, Jiaxun Yang wrote:
> > {f,l,}xstat stub for MIPS is using INTERNAL_SYSCALL
> > to do xstat syscall for glibc ver, However it leaves
> > errno untouched and thus giving bad errno output.
> >
> > Setup errno properly when syscall returns non-zero.
> >
> > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>
>
> LGTM, thanks.  I fixed the code style (using space instead of
> tabs as the current file is doing) and pushed upstream.
>

this problem introduced in 2.33.
is it possible to backport it to 2.33 and 2.34?


> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
>
> > ---
> >  sysdeps/unix/sysv/linux/mips/fxstat.c | 4 +++-
> >  sysdeps/unix/sysv/linux/mips/lxstat.c | 4 +++-
> >  sysdeps/unix/sysv/linux/mips/xstat.c  | 4 +++-
> >  3 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/sysdeps/unix/sysv/linux/mips/fxstat.c
> b/sysdeps/unix/sysv/linux/mips/fxstat.c
> > index 11511d30b3..6d2750adcd 100644
> > --- a/sysdeps/unix/sysv/linux/mips/fxstat.c
> > +++ b/sysdeps/unix/sysv/linux/mips/fxstat.c
> > @@ -35,7 +35,9 @@ __fxstat (int vers, int fd, struct stat *buf)
> >        {
> >       struct kernel_stat kbuf;
> >       int r = INTERNAL_SYSCALL_CALL (fstat, fd, &kbuf);
> > -     return r ?: __xstat_conv (vers, &kbuf, buf);
> > +        if (r == 0)
> > +          return  __xstat_conv (vers, &kbuf, buf);
> > +        return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
> >        }
> >      }
> >  }
> > diff --git a/sysdeps/unix/sysv/linux/mips/lxstat.c
> b/sysdeps/unix/sysv/linux/mips/lxstat.c
> > index 871fb6c6c5..77656be276 100644
> > --- a/sysdeps/unix/sysv/linux/mips/lxstat.c
> > +++ b/sysdeps/unix/sysv/linux/mips/lxstat.c
> > @@ -35,7 +35,9 @@ __lxstat (int vers, const char *name, struct stat *buf)
> >        {
> >       struct kernel_stat kbuf;
> >       int r = INTERNAL_SYSCALL_CALL (lstat, name, &kbuf);
> > -     return r ?: __xstat_conv (vers, &kbuf, buf);
> > +        if (r == 0)
> > +          return  __xstat_conv (vers, &kbuf, buf);
> > +        return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
> >        }
> >      }
> >  }
> > diff --git a/sysdeps/unix/sysv/linux/mips/xstat.c
> b/sysdeps/unix/sysv/linux/mips/xstat.c
> > index 9d810b6f65..4c6fabb502 100644
> > --- a/sysdeps/unix/sysv/linux/mips/xstat.c
> > +++ b/sysdeps/unix/sysv/linux/mips/xstat.c
> > @@ -35,7 +35,9 @@ __xstat (int vers, const char *name, struct stat *buf)
> >        {
> >       struct kernel_stat kbuf;
> >       int r = INTERNAL_SYSCALL_CALL (stat, name, &kbuf);
> > -     return r ?: __xstat_conv (vers, &kbuf, buf);
> > +        if (r == 0)
> > +          return  __xstat_conv (vers, &kbuf, buf);
> > +        return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
> >        }
> >      }
> >  }
> >
>

  reply	other threads:[~2021-09-07 13:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07  5:31 [PATCH] MIPS: Setup errno for {f,l,}xstat Jiaxun Yang
2021-09-07 13:15 ` Adhemerval Zanella via Libc-alpha
2021-09-07 13:20   ` YunQiang Su [this message]
2021-09-07 14:04     ` Adhemerval Zanella via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKcpw6Uuw7+sF2agtU_uaDnc-6jD+aEp5E8tdKE0OqnzX6NHeQ@mail.gmail.com \
    --to=syq@debian.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=xry111@mengyan1223.wang \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).