git-interrupt_timeout_EIO
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Wed, 5 Dec 2018 18:50:21 +0000 (18:50 +0000)
committerAurelien Jarno <aurel32@debian.org>
Wed, 5 Dec 2018 18:50:21 +0000 (18:50 +0000)
commit 16d61b858ec0e802008d721e150e48d6083d3921
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Tue Oct 9 22:25:19 2018 +0200

    hurd: Return EIEIO on non-responding interrupted servers

    since we do not actually know whether the RPC was completed or not,
    which makes a huge difference for e.g. write(), so better really error
    out than letting caller think that the RPC did not happen.

            * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): When the server does not
            answer to interrupt_operation, return EIEIO instead of EINTR.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-interrupt_timeout_EIO.diff

hurd/intr-msg.c

index 2f83ac6ce73395d0982288e9e688cb6f3ecb7069..ec8dc5e1fb7593ce85577c8eedc3ee538dd91402 100644 (file)
@@ -141,7 +141,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
       else
        /* The operation was supposedly interrupted, but still has
           not returned.  Declare it interrupted.  */
-       goto interrupted;
+       goto dead;
 
     case MACH_SEND_INTERRUPTED: /* RPC didn't get out.  */
       if (!(option & MACH_SEND_MSG))
@@ -324,17 +324,21 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
          timeout = user_timeout;
          goto message;
        }
-      /* FALLTHROUGH */
+      err = EINTR;
+
+      /* The EINTR return indicates cancellation, so clear the flag.  */
+      ss->cancel = 0;
+      break;
 
     case MACH_RCV_PORT_DIED:
       /* Server didn't respond to interrupt_operation,
         so the signal thread destroyed the reply port.  */
       /* FALLTHROUGH */
 
-    interrupted:
-      err = EINTR;
+    dead:
+      err = EIEIO;
 
-      /* The EINTR return indicates cancellation, so clear the flag.  */
+      /* The EIEIO return indicates cancellation, so clear the flag.  */
       ss->cancel = 0;
       break;