From: Brent W. Baccala Date: Mon, 31 Oct 2016 16:31:56 +0000 (+0100) Subject: hurd: Fix spurious port deallocation X-Git-Tag: glibc-2.25~355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=561ff1ec4251c8dca011dbcf7500b3970b2cf59b;p=thirdparty%2Fglibc.git hurd: Fix spurious port deallocation * sysdeps/mach/hurd/dl-sysdep.c (__mmap): Do not deallocate memobj_wr when it is MACH_PORT_NULL. --- diff --git a/ChangeLog b/ChangeLog index e6d312153ec..1a14fdfab69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-10-31 Brent W. Baccala + + * sysdeps/mach/hurd/dl-sysdep.c (__mmap): Do not deallocate memobj_wr + when it is MACH_PORT_NULL. + 2016-10-31 Andreas Schwab [BZ #20707] diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 76140cf093d..d730f822800 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -473,7 +473,8 @@ __mmap (__ptr_t 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; - __mach_port_deallocate (__mach_task_self (), memobj_wr); + if (memobj_wr != MACH_PORT_NULL) + __mach_port_deallocate (__mach_task_self (), memobj_wr); } mapaddr = (vm_address_t) addr;