support Android's crippled lsof

This commit is contained in:
Joey Hess 2013-02-11 17:24:12 -04:00
parent a7ef05a988
commit 5737c49804
3 changed files with 28 additions and 7 deletions

View file

@ -281,7 +281,10 @@ safeToAdd delayadd pending inprocess = do
void $ liftIO $ tryIO $ removeFile $ contentLocation ks
canceladd _ = noop
openwrite (_file, mode, _pid) =
mode == Lsof.OpenWriteOnly || mode == Lsof.OpenReadWrite
openwrite (_file, mode, _pid)
| mode == Lsof.OpenWriteOnly = True
| mode == Lsof.OpenReadWrite = True
| mode == Lsof.OpenUnknown = True
| otherwise = False
allRight = return . map Right