about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-04-06 01:49:21 +0000
committerMiles Bader <miles@gnu.org>1996-04-06 01:49:21 +0000
commitaa0e1b599cc4d836067fb1157ee16315f2f62439 (patch)
treee85aa9ba0bd56a4726c6cd01f93f8fe41ad6f307
parent2e516341fa742b2d7162934143d6ff394e63c93b (diff)
downloadglibc-aa0e1b599cc4d836067fb1157ee16315f2f62439.tar.gz
glibc-aa0e1b599cc4d836067fb1157ee16315f2f62439.tar.xz
glibc-aa0e1b599cc4d836067fb1157ee16315f2f62439.zip
(__mig_dealloc_reply_port): Only attempt to destroy PORT if it's a valid port name.
-rw-r--r--sysdeps/mach/hurd/mig-reply.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sysdeps/mach/hurd/mig-reply.c b/sysdeps/mach/hurd/mig-reply.c
index feb03257dd..b5c43fa26f 100644
--- a/sysdeps/mach/hurd/mig-reply.c
+++ b/sysdeps/mach/hurd/mig-reply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -52,8 +52,10 @@ __mig_dealloc_reply_port (mach_port_t arg)
 
   port = reply_port;
   reply_port = MACH_PORT_NULL;	/* So the mod_refs RPC won't use it.  */
-  __mach_port_mod_refs (__mach_task_self (), port,
-			MACH_PORT_RIGHT_RECEIVE, -1);
+
+  if (MACH_PORT_VALID (port))
+    __mach_port_mod_refs (__mach_task_self (), port,
+			  MACH_PORT_RIGHT_RECEIVE, -1);
 }
 weak_alias (__mig_dealloc_reply_port, mig_dealloc_reply_port)