summaryrefslogtreecommitdiffstats
path: root/sysif.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-05-11 07:54:37 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-05-11 07:54:37 -0700
commit358ed61b023006bff29d09611bda9a57f26ca5ab (patch)
tree4c3c9bf5e80d30c5b8290d8285464e6bc180d87e /sysif.c
parent37ae889a553a325e401b7d0f416427b6183b1ba4 (diff)
downloadtxr-358ed61b023006bff29d09611bda9a57f26ca5ab.tar.gz
txr-358ed61b023006bff29d09611bda9a57f26ca5ab.tar.bz2
txr-358ed61b023006bff29d09611bda9a57f26ca5ab.zip
sysif: define passwd symbol for group stuff.
* sysif.c (sysif_init): The passwd symbol is used by both the passwd and group structure, so we need to initialize it if either HAVE_PWUID or HAVE_GRGID is set. Certain Android SDK levels have getgrgid but not getpwuid, so it's possible to end up with HAVE_GRGID but not HAVE_PWUID, in which case passwd_s ends up nil, blowing up the make_struct_type call.
Diffstat (limited to 'sysif.c')
-rw-r--r--sysif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysif.c b/sysif.c
index 8bf81867..2f10720e 100644
--- a/sysif.c
+++ b/sysif.c
@@ -2539,8 +2539,10 @@ void sysif_init(void)
path_s = intern(lit("path"), user_package);
dir_s = intern(lit("dir"), user_package);
dirent_s = intern(lit("dirent"), user_package);
-#if HAVE_PWUID
+#if HAVE_PWUID || HAVE_GRGID
passwd_s = intern(lit("passwd"), user_package);
+#endif
+#if HAVE_PWUID
gecos_s = intern(lit("gecos"), user_package);
shell_s = intern(lit("shell"), user_package);
#endif