[PATCH] Set pw_gecos to empty string on android, because it does not exist

Nathan nathan.huesken at posteo.de
Thu Jan 24 15:38:20 CET 2013


---
 System/Posix/User.hsc |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc
index a62648d..2cf0dae 100644
--- a/System/Posix/User.hsc
+++ b/System/Posix/User.hsc
@@ -453,7 +453,11 @@ unpackUserEntry ptr = do
    passwd <- (#peek struct passwd, pw_passwd) ptr >>= peekCAString
    uid    <- (#peek struct passwd, pw_uid)    ptr
    gid    <- (#peek struct passwd, pw_gid)    ptr
+#ifndef __ANDROID__
    gecos  <- (#peek struct passwd, pw_gecos)  ptr >>= peekCAString
+#else
+   gecos  <- return ""  -- pw_gecos does not exist on android
+#endif
    dir    <- (#peek struct passwd, pw_dir)    ptr >>= peekCAString
    shell  <- (#peek struct passwd, pw_shell)  ptr >>= peekCAString
    return (UserEntry name passwd uid gid gecos dir shell)
-- 
1.7.10.4


--------------070004030200010403000704
Content-Type: text/x-patch;
 name="02_unix_posix_vdisable.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="02_unix_posix_vdisable.patch"



More information about the ghc-devs mailing list