set fileEncoding on the off chance lsof outputs binary garbage

This commit is contained in:
Joey Hess 2013-02-18 17:20:52 -04:00
parent d799ef3182
commit eb0e5be62f

View file

@ -48,6 +48,7 @@ queryDir path = query ["+d", path]
query :: [String] -> IO [(FilePath, LsofOpenMode, ProcessInfo)]
query opts =
withHandle StdoutHandle (createProcessChecked checkSuccessProcess) p $ \h -> do
fileEncoding h
parse <$> hGetContentsStrict h
where
p = proc "lsof" ("-F0can" : opts)