Index: /trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp	(revision 58291)
+++ /trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp	(revision 58292)
@@ -640,5 +640,4 @@
 
 
-#if 0 /* maybe later */
 /**
  * Checks if the socket has has a HUP condition.
@@ -649,5 +648,5 @@
 static bool rtLocalIpcPosixHasHup(PRTLOCALIPCSESSIONINT pThis)
 {
-# ifndef RT_OS_OS2
+#ifndef RT_OS_OS2
     struct pollfd PollFd;
     RT_ZERO(PollFd);
@@ -657,9 +656,8 @@
        && (PollFd.revents & POLLHUP);
 
-# else /* RT_OS_OS2: */
-    return false;
-# endif
-}
+#else /* RT_OS_OS2: */
+    return true;
 #endif
+}
 
 
@@ -693,4 +691,15 @@
 
                     rc = RTSocketRead(pThis->hSocket, pvBuffer, cbBuffer, pcbRead);
+
+                    /* Detect broken pipe. */
+                    if (rc == VINF_SUCCESS)
+                    {
+                        if (!pcbRead || *pcbRead)
+                        { /* likely */ }
+                        else if (rtLocalIpcPosixHasHup(pThis))
+                            rc = VERR_BROKEN_PIPE;
+                    }
+                    else if (rc == VERR_NET_CONNECTION_RESET_BY_PEER || rc == VERR_NET_SHUTDOWN)
+                        rc = VERR_BROKEN_PIPE;
 
                     int rc2 = RTCritSectEnter(&pThis->CritSect);
