windows: Fix process termination code.
The ctrl-c hack used before didn't actually seem to work. No haskell libraries expose TerminateProcess. I tried just calling it via FFI, but got segfaults, probably to do with the wacky process handle not being managed correctly. Moving it all into one C function worked. This was hell. The EvilLinker hack was just final icing on the cake. We all know what the cake was made of.
This commit is contained in:
parent
84083ecdd3
commit
f11f7520b5
10 changed files with 58 additions and 24 deletions
19
Utility/WinProcess.hs
Normal file
19
Utility/WinProcess.hs
Normal file
|
@ -0,0 +1,19 @@
|
|||
{- Windows processes
|
||||
-
|
||||
- Copyright 2014 Joey Hess <joey@kitenet.net>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE ForeignFunctionInterface #-}
|
||||
|
||||
module Utility.WinProcess where
|
||||
|
||||
import Utility.PID
|
||||
|
||||
import System.Win32.Process
|
||||
import Foreign.C
|
||||
import Control.Exception
|
||||
|
||||
foreign import ccall unsafe "terminatepid"
|
||||
terminatePID :: PID -> IO ()
|
Loading…
Add table
Add a link
Reference in a new issue