Revert "try to avoid TerminateProcess link error on windows"
This reverts commit 839ec7e26c
.
Neither way is working.. The other way failed:
.stack-work\dist\5f9bc736\build\git-annex\git-annex-tmp\Assistant.o:fake:(.text+0x6bb3): undefined reference to `terminatepid'
Seems that winprocess.c is not getting linked in.
This commit is contained in:
parent
bcd394657f
commit
901807cf75
4 changed files with 15 additions and 17 deletions
|
@ -11,5 +11,18 @@ module Utility.WinProcess where
|
|||
|
||||
import Utility.PID
|
||||
|
||||
foreign import ccall unsafe "winprocess.h terminatepid"
|
||||
terminatePID :: PID -> IO ()
|
||||
import System.Win32.Process
|
||||
import Control.Exception (bracket)
|
||||
import Control.Monad
|
||||
|
||||
terminatePID :: PID -> IO ()
|
||||
terminatePID p = bracket
|
||||
(openProcess pROCESS_TERMINATE False p)
|
||||
(void . c_closeProcess)
|
||||
(\h -> void $ c_TerminateProcess h 1)
|
||||
|
||||
foreign import ccall unsafe "windows.h TerminateProcess"
|
||||
c_TerminateProcess :: ProcessHandle -> Int -> IO Int
|
||||
|
||||
foreign import ccall unsafe "windows.h CloseHandle"
|
||||
c_closeProcess :: ProcessHandle -> IO Bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue