Import Data.ByteString.Lazy, improve ByteString Fusion, and resync with FPS head
[ghc-base.git] / cbits / runProcess.c
index 0a69421..b89e130 100644 (file)
@@ -216,7 +216,7 @@ int waitForProcess (ProcHandle handle)
     else
        if (WIFSIGNALED(wstat))
        {
-           errno = EINTR;
+           return wstat;
        }
        else
        {
@@ -518,8 +518,6 @@ terminateProcess (ProcHandle handle)
        maperrno();
        return -1;
     }
-
-    CloseHandle((HANDLE) handle);
     return 0;
 }
 
@@ -535,8 +533,6 @@ getProcessExitCode (ProcHandle handle, int *pExitCode)
            maperrno();
            return -1;
        }
-       
-       CloseHandle((HANDLE) handle);
        return 1;
     }
     
@@ -555,8 +551,6 @@ waitForProcess (ProcHandle handle)
            maperrno();
            return -1;
        }
-       
-       CloseHandle((HANDLE) handle);
        return retCode;
     }