From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-2.4 required=3.0 tests=BAYES_00,BODY_8BITS, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 29F8D1F8C6 for ; Tue, 7 Sep 2021 13:20:43 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C395385ED4A for ; Tue, 7 Sep 2021 13:20:42 +0000 (GMT) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by sourceware.org (Postfix) with ESMTPS id A760D385842D for ; Tue, 7 Sep 2021 13:20:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A760D385842D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f43.google.com with SMTP id bn14so5739371qvb.12 for ; Tue, 07 Sep 2021 06:20:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4b+tNqaDjqnLn3FJVH+/3hjt0Sq56PNgrJ28OD3bpU8=; b=m4IATpR/9bvecwRO4nkmYVK9NgE0c7y5aVLj72KWHy5YbILbyA700urEp09Zh+l0fZ Me1qsNZSdKGYKpFsXVAd/tPrNxRBf8oghpG8ib/RVltpxj9oS1nPLaW2cBsQPvTaCrTZ GZcSlGPudL1KC5+J9G0r8ze/vYQQlnjhN7qep1W3hwPWEa/J/P8/6nHXGOmsS11thglI 8T9aREI+wD2VVFmZglfMOXCfLYYhLnPAVmSPYKZuk9GCiTbaAdFRlp67O+S8HLAMnGLe BgpOTe6JRyvngfoERL5xUzMP1qF1Qh4tACGgedzXWIWloYaFeYGFd4xSQkF7K6gU3U+5 FCtA== X-Gm-Message-State: AOAM533X8NTBozKJFhIeCpf14vk5NcA/IyfjnvbCe8iuH3pGuTdLhfJ+ cFg7ICrB2RF1NHuAzL6PxgOqSNnWneK6ByXweFOyY5fEqxI= X-Google-Smtp-Source: ABdhPJz9cR4Cx6N+EMg4LRo6e41paBLDSBG2hsfLIhSvbQnDf+9uqIhpDMC17GOCT7OgcCHl5TreTMvESZvR15X1Zy4= X-Received: by 2002:ad4:55c8:: with SMTP id bt8mr16897363qvb.28.1631020831313; Tue, 07 Sep 2021 06:20:31 -0700 (PDT) MIME-Version: 1.0 References: <20210907053142.1774-1-jiaxun.yang@flygoat.com> <43d37c1b-6efc-c688-cc4a-f6514ff3c6b8@linaro.org> In-Reply-To: <43d37c1b-6efc-c688-cc4a-f6514ff3c6b8@linaro.org> From: YunQiang Su Date: Tue, 7 Sep 2021 21:20:19 +0800 Message-ID: Subject: Re: [PATCH] MIPS: Setup errno for {f,l,}xstat To: Adhemerval Zanella Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libc-alpha@sourceware.org, Xi Ruoyao , Jiaxun Yang Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" Adhemerval Zanella =E4=BA=8E 2021=E5=B9=B49= =E6=9C=887=E6=97=A5=E5=91=A8=E4=BA=8C =E4=B8=8B=E5=8D=889:15=E5=86=99=E9=81= =93=EF=BC=9A > > > 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 > > > 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 > > > --- > > 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 =3D INTERNAL_SYSCALL_CALL (fstat, fd, &kbuf); > > - return r ?: __xstat_conv (vers, &kbuf, buf); > > + if (r =3D=3D 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 *bu= f) > > { > > struct kernel_stat kbuf; > > int r =3D INTERNAL_SYSCALL_CALL (lstat, name, &kbuf); > > - return r ?: __xstat_conv (vers, &kbuf, buf); > > + if (r =3D=3D 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 =3D INTERNAL_SYSCALL_CALL (stat, name, &kbuf); > > - return r ?: __xstat_conv (vers, &kbuf, buf); > > + if (r =3D=3D 0) > > + return __xstat_conv (vers, &kbuf, buf); > > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r); > > } > > } > > } > > >