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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Nathan Hüsken
---
 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"