]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
pwcache: Do not declare uidtb and gidtb when not used
authorGuillem Jover <guillem@hadrons.org>
Thu, 27 Jul 2023 11:57:51 +0000 (13:57 +0200)
committerGuillem Jover <guillem@hadrons.org>
Tue, 5 Sep 2023 01:02:20 +0000 (03:02 +0200)
When the system provides implementations for user_from_uid() or
group_from_gid() we are not using these variables, so better not declare
them.

Fixes: commit 21d12b02112097f0c195dceb1892c95b7b957b36
src/pwcache.c

index 99609d9b301111262e65eb723c493098336afd55..8ed855ccc67593cb9cf436820af5fde24781e994 100644 (file)
@@ -83,8 +83,12 @@ typedef struct gidc {
  * cache both hits and misses.
  */
 
+#ifndef HAVE_USER_FROM_UID
 static UIDC **uidtb;   /* uid to name cache */
+#endif
+#ifndef HAVE_GROUP_FROM_GID
 static GIDC **gidtb;   /* gid to name cache */
+#endif
 static UIDC **usrtb;   /* user name to uid cache */
 static GIDC **grptb;   /* group name to gid cache */