include external special remote process number in debug

Not actual pid, because System.Process does not expose that.
This commit is contained in:
Joey Hess 2016-09-30 14:42:48 -04:00
parent 5bf4623a1d
commit 37c8c6df99
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
2 changed files with 19 additions and 10 deletions

View file

@ -48,6 +48,7 @@ data External = External
, externalState :: TMVar [ExternalState]
-- ^ TMVar is never left empty; list contains states for external
-- special remote processes that are not currently in use.
, externalLastPid :: TMVar PID
, externalDefaultConfig :: RemoteConfig
, externalGitConfig :: RemoteGitConfig
}
@ -57,6 +58,7 @@ newExternal externaltype u c gc = liftIO $ External
<$> pure externaltype
<*> pure u
<*> atomically (newTMVar [])
<*> atomically (newTMVar 0)
<*> pure c
<*> pure gc
@ -66,12 +68,15 @@ data ExternalState = ExternalState
{ externalSend :: Handle
, externalReceive :: Handle
, externalShutdown :: IO ()
, externalPid :: PID
, externalPrepared :: TMVar PrepareStatus
-- ^ Never left empty.
, externalConfig :: TMVar RemoteConfig
-- ^ Never left empty.
}
type PID = Int
data PrepareStatus = Unprepared | Prepared | FailedPrepare ErrorMsg
-- Messages that can be sent to the external remote to request it do something.