]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - hurd/hurdselect.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / hurd / hurdselect.c
index 2996be2c8b7bf46efe4d184d483d36d5095d2c2f..d5ba826d16d00e62f70b946bff55e58b8778c5b1 100644 (file)
@@ -1,5 +1,5 @@
 /* Guts of both `select' and `poll' for Hurd.
-   Copyright (C) 1991-2015 Free Software Foundation, Inc.
+   Copyright (C) 1991-2016 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
@@ -335,7 +335,7 @@ _hurd_select (int nfds,
       mach_msg_option_t options = (timeout == NULL ? 0 : MACH_RCV_TIMEOUT);
       error_t msgerr;
       while ((msgerr = __mach_msg (&msg.head,
-                                  MACH_RCV_MSG | options,
+                                  MACH_RCV_MSG | MACH_RCV_INTERRUPT | options,
                                   0, sizeof msg, portset, to,
                                   MACH_PORT_NULL)) == MACH_MSG_SUCCESS)
        {
@@ -407,13 +407,9 @@ _hurd_select (int nfds,
            }
        }
 
-      if (err == MACH_RCV_TIMED_OUT)
-       /* This is the normal value for ERR.  We might have timed out and
-          read no messages.  Otherwise, after receiving the first message,
-          we poll for more messages.  We receive with a timeout of 0 to
-          effect a poll, so ERR is MACH_RCV_TIMED_OUT when the poll finds no
-          message waiting.  */
-       err = 0;
+      if (msgerr == MACH_RCV_INTERRUPTED)
+       /* Interruption on our side (e.g. signal reception).  */
+       err = EINTR;
 
       if (got)
        /* At least one descriptor is known to be ready now, so we will