summaryrefslogtreecommitdiff
path: root/Utility/Lsof.hs
diff options
context:
space:
mode:
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