diff options
author | Joey Hess <joey@kitenet.net> | 2013-02-19 18:06:27 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-02-19 18:06:27 -0400 |
commit | 43aea5aeeebdc143cf5732a0e4a72d74ba49e6d1 (patch) | |
tree | f39d71abf9e474e5facbf2849edef9be79daa8a3 /Utility | |
parent | 5501aba620d9124735b632d584ef990a18fc2f13 (diff) |
avoid trying to use GECOS on Android, which responds with sig11
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/UserInfo.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index 8fba3e17f..00790f615 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -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 |