temporary hack to get windows build working
Code for terminating processes on Windows is not linking anymore; made a warning be displayed instead. This breaks restarting the assistant and git annex assistant --stop. I hope to see the code added to the Win32 library, where it should fit better and should avoid whatever problem is making the linker not like it when included in git-annex. I opened an issue requesting its addition, here: https://github.com/haskell/win32/issues/91 This commit was sponsored by Thomas Hochstein on Patreon.
This commit is contained in:
parent
901807cf75
commit
3e839ab327
2 changed files with 11 additions and 16 deletions
|
@ -5,24 +5,9 @@
|
|||
- License: BSD-2-clause
|
||||
-}
|
||||
|
||||
{-# LANGUAGE ForeignFunctionInterface #-}
|
||||
|
||||
module Utility.WinProcess where
|
||||
|
||||
import Utility.PID
|
||||
|
||||
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
|
||||
terminatePID p = warning "terminating processes on windows is not currently working"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue