tidy-cygwin-modifications

This commit is contained in:
vivian.mcphail
2005-05-07 08:07:34 +00:00
parent 6e8f0dc68f
commit d431902833
4 changed files with 38 additions and 13 deletions

View File

@ -97,9 +97,8 @@ gettemp path doopen domkdir slen = do
--
-- replace end of template with process id, and rest with randomness
--
;pid <- liftM show $ abs `fmap` getProcessID
-- getProcessID returns a negative number? why, dunno, but the minus
-- sign screws up Module header names, illegal char.
;pid <- liftM show $ do {v <- getProcessID ; return $ abs v} -- getProcessID returns a negative number? why, dunno, but the minus sign screws up Module header names, illegal char.
-- ;pid <- liftM show $ getProcessID
;let (rest, xs) = merge tmpl pid
;as <- randomise rest
;let tmpl' = as ++ xs
@ -244,8 +243,12 @@ mkdir0700 dir = createDirectory dir
foreign import ccall unsafe "_getpid" getProcessID :: IO Int
#else
getProcessID :: IO Int
#ifdef CYGWIN
getProcessID = System.Posix.Internals.c_getpid >>= return . abs . fromIntegral
#else
getProcessID = System.Posix.Internals.c_getpid >>= return . fromIntegral
#endif
#endif
-- ---------------------------------------------------------------------
-- | Use a variety of random functions, if you like.