avoid trying to use GECOS on Android, which responds with sig11
This commit is contained in:
parent
56e56d98c7
commit
e1dba0c3dc
1 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,8 @@
|
|||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Utility.UserInfo (
|
||||
myHomeDir,
|
||||
myUserName,
|
||||
|
@ -26,7 +28,11 @@ myUserName :: IO String
|
|||
myUserName = myVal ["USER", "LOGNAME"] userName
|
||||
|
||||
myUserGecos :: IO String
|
||||
#ifdef WITH_ANDROID
|
||||
myUserGecos = return "" -- userGecos crashes on Android
|
||||
#else
|
||||
myUserGecos = myVal [] userGecos
|
||||
#endif
|
||||
|
||||
myVal :: [String] -> (UserEntry -> String) -> IO String
|
||||
myVal envvars extract = maybe (extract <$> getpwent) return =<< check envvars
|
||||
|
|
Loading…
Reference in a new issue