aboutsummaryrefslogtreecommitdiff
path: root/Utility/Lsof.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-15 22:16:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-15 22:16:13 -0400
commitd91950ecbad5f33e4d9ce80fc4256c55e0879cc2 (patch)
treec7c411d63a9458e7dc85ed2a0d25cbb94721b9df /Utility/Lsof.hs
parente32dda07ca739d2fcab7a764916643d247e94a1b (diff)
cleanup
Diffstat (limited to 'Utility/Lsof.hs')
-rw-r--r--Utility/Lsof.hs7
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