summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
Diffstat (limited to 'Utility')
-rw-r--r--Utility/SimpleProtocol.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Utility/SimpleProtocol.hs b/Utility/SimpleProtocol.hs
index 728b135e8..473129218 100644
--- a/Utility/SimpleProtocol.hs
+++ b/Utility/SimpleProtocol.hs
@@ -24,6 +24,7 @@ module Utility.SimpleProtocol (
import Data.Char
import GHC.IO.Handle
+import System.Exit (ExitCode(..))
import Common
@@ -95,3 +96,9 @@ dupIoHandles = do
instance Serializable [Char] where
serialize = id
deserialize = Just
+
+instance Serializable ExitCode where
+ serialize ExitSuccess = "0"
+ serialize (ExitFailure n) = show n
+ deserialize "0" = Just ExitSuccess
+ deserialize s = ExitFailure <$> readish s