public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] hurd: Fix tst-openloc Date: Thu, 20 Jul 2023 21:44:27 +0000 (GMT) [thread overview] Message-ID: <20230720214427.A6AD73858CD1@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f7f181c12c140ff1fe45376b98fe32eb491e363f commit f7f181c12c140ff1fe45376b98fe32eb491e363f Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Thu Jul 20 23:38:24 2023 +0200 hurd: Fix tst-openloc On GNU/Hurd, O_RDWR actually is O_WRONLY|O_RDONLY, so checking through bitness really is wrong. O_ACCMODE is there for this. Fixes: 5324d258427f ("fileops: Don't process ,ccs= as individual mode flags (BZ#18906)") Diff: --- libio/tst-fopenloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libio/tst-fopenloc.c b/libio/tst-fopenloc.c index 5b3c1849ef..51a485c194 100644 --- a/libio/tst-fopenloc.c +++ b/libio/tst-fopenloc.c @@ -76,7 +76,8 @@ do_bz18906 (void) if (fp != NULL) { flags = fcntl (fileno (fp), F_GETFL); - retval = (flags & O_RDWR) | (flags & O_WRONLY); + retval = ((flags & O_ACCMODE) == O_RDWR); + retval |= ((flags & O_ACCMODE) == O_WRONLY); TEST_COMPARE (retval, false); fclose (fp); }
reply other threads:[~2023-07-20 21:44 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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 * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230720214427.A6AD73858CD1@sourceware.org \ --to=sthibaul@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /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: linkBe 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).