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 fcntl: Make LOCKED macro more robust
Date: Mon,  2 Jan 2023 10:36:41 +0000 (GMT)	[thread overview]
Message-ID: <20230102103641.D3A483858C33@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e1a467d330d2dd4ab83adcadeba75961952ec826

commit e1a467d330d2dd4ab83adcadeba75961952ec826
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Jan 2 01:54:18 2023 +0100

    hurd fcntl: Make LOCKED macro more robust

Diff:
---
 sysdeps/mach/hurd/fcntl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index ea35e9b977..48608493a1 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -109,7 +109,7 @@ __libc_fcntl (int fd, int cmd, ...)
 
       /* Set RESULT by evaluating EXPR with the descriptor locked.
 	 Check for an empty descriptor and return EBADF.  */
-#define LOCKED(expr)							      \
+#define LOCKED(expr) do {						      \
       HURD_CRITICAL_BEGIN;						      \
       __spin_lock (&d->port.lock);					      \
       if (d->port.port == MACH_PORT_NULL)				      \
@@ -117,7 +117,8 @@ __libc_fcntl (int fd, int cmd, ...)
       else								      \
 	result = (expr);						      \
       __spin_unlock (&d->port.lock);					      \
-      HURD_CRITICAL_END;
+      HURD_CRITICAL_END;						      \
+} while(0)
 
     case F_GETFD:		/* Get descriptor flags.  */
       LOCKED (d->flags);

                 reply	other threads:[~2023-01-02 10:36 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=20230102103641.D3A483858C33@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: 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).