diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-15 22:16:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-15 22:16:13 -0400 |
commit | d91950ecbad5f33e4d9ce80fc4256c55e0879cc2 (patch) | |
tree | c7c411d63a9458e7dc85ed2a0d25cbb94721b9df /Utility | |
parent | e32dda07ca739d2fcab7a764916643d247e94a1b (diff) |
cleanup
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Lsof.hs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Utility/Lsof.hs b/Utility/Lsof.hs index 0491487bc..1c0e934fd 100644 --- a/Utility/Lsof.hs +++ b/Utility/Lsof.hs @@ -11,11 +11,10 @@ module Utility.Lsof where import Common -import System.Cmd.Utils import System.Posix.Types data LsofOpenMode = OpenReadWrite | OpenReadOnly | OpenWriteOnly | OpenUnknown - deriving (Show) + deriving (Show, Eq) type CmdLine = String @@ -46,7 +45,7 @@ parse s = bundle $ go [] $ lines s bundle = concatMap (\(fs, p) -> map (\(f, m) -> (f, m, p)) fs) go c [] = c - go c (l@(t:r):ls) + go c ((t:r):ls) | t == 'p' = let (fs, ls') = parsefiles [] ls in go ((fs, parseprocess r):c) ls' @@ -74,8 +73,6 @@ parse s = bundle $ go [] $ lines s parsemode ('u':_) = OpenReadWrite parsemode _ = OpenUnknown - ls = lines s - splitnull = split "\0" parsefail = error $ "failed to parse lsof output: " ++ show s |