about summary refs log tree commit diff
path: root/hurd/hurdexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'hurd/hurdexec.c')
-rw-r--r--hurd/hurdexec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c
index 18ad9ef38d..30a27e8048 100644
--- a/hurd/hurdexec.c
+++ b/hurd/hurdexec.c
@@ -186,6 +186,10 @@ _hurd_exec (task_t task, file_t file,
       dtable_cells = NULL;
     }
 
+  /* Prune trailing null ports from the descriptor table.  */
+  while (dtable[dtablesize - 1] == MACH_PORT_NULL)
+    --dtablesize;
+
   /* The information is all set up now.  Try to exec the file.  */
 
   {