public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Sergey Bugaev <bugaevc@gmail.com>
Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org
Subject: Re: [PATCH 2/4] hurd: Don't attempt to deallocate MACH_PORT_DEAD
Date: Mon, 24 Apr 2023 22:44:59 +0200	[thread overview]
Message-ID: <20230424204458.jfvh2ct4gr5r74hh@begin> (raw)
In-Reply-To: <20230423215526.346009-2-bugaevc@gmail.com>

Applied, thanks!

Sergey Bugaev, le lun. 24 avril 2023 00:55:24 +0300, a ecrit:
> ...in some more places.
> 
> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
> ---
>  sysdeps/mach/hurd/dl-sysdep.c | 2 +-
>  sysdeps/mach/hurd/mmap.c      | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
> index d7b309e0..25a12774 100644
> --- a/sysdeps/mach/hurd/dl-sysdep.c
> +++ b/sysdeps/mach/hurd/dl-sysdep.c
> @@ -472,7 +472,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
>        err = __io_map ((mach_port_t) fd, &memobj_rd, &memobj_wr);
>        if (err)
>  	return __hurd_fail (err), MAP_FAILED;
> -      if (memobj_wr != MACH_PORT_NULL)
> +      if (MACH_PORT_VALID (memobj_wr))
>  	__mach_port_deallocate (__mach_task_self (), memobj_wr);
>      }
>  
> diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
> index c3cc1856..790eb238 100644
> --- a/sysdeps/mach/hurd/mmap.c
> +++ b/sysdeps/mach/hurd/mmap.c
> @@ -91,7 +91,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
>              if (wobj == robj)
>                max_vmprot |= VM_PROT_WRITE;
>  	    memobj = robj;
> -	    if (wobj != MACH_PORT_NULL)
> +	    if (MACH_PORT_VALID (wobj))
>  	      __mach_port_deallocate (__mach_task_self (), wobj);
>  	    break;
>  	  case PROT_WRITE:
> @@ -99,7 +99,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
>              if (robj == wobj)
>                max_vmprot |= VM_PROT_READ|VM_PROT_EXECUTE;
>  	    memobj = wobj;
> -	    if (robj != MACH_PORT_NULL)
> +	    if (MACH_PORT_VALID (robj))
>  	      __mach_port_deallocate (__mach_task_self (), robj);
>  	    break;
>  	  case PROT_READ|PROT_WRITE:
> @@ -167,7 +167,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
>  			copy ? VM_INHERIT_COPY : VM_INHERIT_SHARE);
>      }
>  
> -  if (memobj != MACH_PORT_NULL)
> +  if (MACH_PORT_VALID (memobj))
>      __mach_port_deallocate (__mach_task_self (), memobj);
>  
>    if (err == KERN_PROTECTION_FAILURE)
> -- 
> 2.40.0
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.

  reply	other threads:[~2023-04-24 20:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23 21:55 [PATCH 1/4] hurd: Implement MAP_32BIT Sergey Bugaev
2023-04-23 21:55 ` [PATCH 2/4] hurd: Don't attempt to deallocate MACH_PORT_DEAD Sergey Bugaev
2023-04-24 20:44   ` Samuel Thibault [this message]
2023-04-23 21:55 ` [PATCH 3/4] hurd: Microoptimize mmap () Sergey Bugaev
2023-04-24 20:46   ` Samuel Thibault
2023-04-24 21:09     ` Sergey Bugaev
2023-04-24 21:25       ` Samuel Thibault
2023-04-23 21:55 ` [RFC PATCH 4/4] hurd: Implement prefer_map_32bit_exec tunable Sergey Bugaev
2023-04-24 20:48   ` Samuel Thibault
2023-04-24 20:42 ` [PATCH 1/4] hurd: Implement MAP_32BIT Samuel Thibault

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=20230424204458.jfvh2ct4gr5r74hh@begin \
    --to=samuel.thibault@gnu.org \
    --cc=bug-hurd@gnu.org \
    --cc=bugaevc@gmail.com \
    --cc=libc-alpha@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).