From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1792) id A6AD73858CD1; Thu, 20 Jul 2023 21:44:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6AD73858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689889467; bh=Tj+YNA2ttFEjLrEAMFrZbSGX23C19tFdAV96iD6NWV4=; h=From:To:Subject:Date:From; b=oZ1GMnPyuQfZL8gGzUBL5Bn1QTvOPB8IQjogbHf3iAFeH99NYBKd24/ppP4ZWDSJu UYQQeFijBQAblIKKCEFHUyxhDedN+omyqpTHuzV3SIaRL8cYizhEuc7Wz/xYA6H2rO aQ6VOLIm+FRT8Z2dCQqELvkyf1+zyTxK2Zy6+QiU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Samuel Thibault To: glibc-cvs@sourceware.org Subject: [glibc] hurd: Fix tst-openloc X-Act-Checkin: glibc X-Git-Author: Samuel Thibault X-Git-Refname: refs/heads/master X-Git-Oldrev: a3090c2c98facbab3d47aa23a94f8d2caeb78d71 X-Git-Newrev: f7f181c12c140ff1fe45376b98fe32eb491e363f Message-Id: <20230720214427.A6AD73858CD1@sourceware.org> Date: Thu, 20 Jul 2023 21:44:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f7f181c12c140ff1fe45376b98fe32eb491e363f commit f7f181c12c140ff1fe45376b98fe32eb491e363f Author: Samuel Thibault 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); }