diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-05-15 18:10:13 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-05-15 21:36:03 -0400 |
commit | 973180b077e60b5d12d7c57d926878d11d7f2105 (patch) | |
tree | 7d3bc5e651d330c1945c81f356b59eca90e73ea2 /Utility/LockFile/PidLock.hs | |
parent | 0d85a42333484e1acb8e4942a619087768bc62fb (diff) |
stop using MissingH for MD5
Cryptonite is faster and allocates less, and I want to get rid of
MissingH use.
Note that the new dependency on memory is free; it's a dependency of
cryptonite.
This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Utility/LockFile/PidLock.hs')
-rw-r--r-- | Utility/LockFile/PidLock.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Utility/LockFile/PidLock.hs b/Utility/LockFile/PidLock.hs index 87c11c01c..23560fa57 100644 --- a/Utility/LockFile/PidLock.hs +++ b/Utility/LockFile/PidLock.hs @@ -25,6 +25,8 @@ import Utility.Path import Utility.FileMode import Utility.LockFile.LockStatus import Utility.ThreadScheduler +import Utility.Hash +import Utility.FileSystemEncoding import qualified Utility.LockFile.Posix as Posix import System.IO @@ -33,7 +35,6 @@ import Data.Maybe import Data.List import Network.BSD import System.FilePath -import Data.Hash.MD5 import Control.Applicative import Prelude @@ -99,7 +100,9 @@ sideLockFile lockfile = do f <- absPath lockfile let base = intercalate "_" (splitDirectories (makeRelative "/" f)) let shortbase = reverse $ take 32 $ reverse base - let md5sum = if base == shortbase then "" else md5s (Str base) + let md5sum = if base == shortbase + then "" + else show (md5 (encodeBS base)) dir <- ifM (doesDirectoryExist "/dev/shm") ( return "/dev/shm" , return "/tmp" |