]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - hurd/hurdinit.c
hurd: allow poll() array bigger than FD_SETSIZE
[thirdparty/glibc.git] / hurd / hurdinit.c
index dc5e904c5e7160233367052bfec8ba355df9d834..43d49aa9b097db54aac755dcaa06e7b640b6b6c6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2015 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
@@ -12,9 +12,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <sys/stat.h>
 #include <stdlib.h>
@@ -39,11 +38,19 @@ int __libc_argc;
 error_t
 _hurd_ports_use (int which, error_t (*operate) (mach_port_t))
 {
+  if (__glibc_unlikely (_hurd_ports == NULL))
+    /* This means that _hurd_init has not been called yet, which is
+       normally only the case in the bootstrap filesystem, and there
+       only in the early phases of booting.  */
+    return EGRATUITOUS;
+
   return HURD_PORT_USE (&_hurd_ports[which], (*operate) (port));
 }
 
 DEFINE_HOOK (_hurd_subinit, (void));
 
+__typeof (_hurd_proc_init) _hurd_new_proc_init;        /* below */
+
 /* Initialize the library data structures from the
    ints and ports passed to us by the exec server.
 
@@ -82,7 +89,7 @@ _hurd_init (int flags, char **argv,
 
   /* Tell the proc server we exist, if it does.  */
   if (portarray[INIT_PORT_PROC] != MACH_PORT_NULL)
-    _hurd_proc_init (argv, intarray, intarraysize);
+    _hurd_new_proc_init (argv, intarray, intarraysize);
 
   /* All done with init ints and ports.  */
   __vm_deallocate (__mach_task_self (),
@@ -159,7 +166,7 @@ _hurd_new_proc_init (char **argv,
      while.  Eventually it probably makes most sense for the exec server to
      mask out EXEC_SIGTRAP so the debugged program is closer to not being
      able to tell it's being debugged.  */
-  if (_hurdsig_traced
+  if (!__sigisemptyset (&_hurdsig_traced)
 #ifdef EXEC_SIGTRAP
       && !(_hurd_exec_flags & EXEC_SIGTRAP)
 #endif