summaryrefslogtreecommitdiff
path: root/src/minutils/s6ps_pwcache.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-08 18:52:14 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-08 18:52:14 +0000
commit9be4af55521d653cfb1c5037412e937f800888c7 (patch)
treee79c0cdf1cb15bde9c13e54a5bbf87ad34ce0013 /src/minutils/s6ps_pwcache.c
parent2ece041307a67f02ab1592f623d9d63cbed13489 (diff)
downloads6-linux-utils-9be4af55521d653cfb1c5037412e937f800888c7.tar.xz
Types fix, first pass
Deeper fixes need to be done if the avltree.h API ever changes.
Diffstat (limited to 'src/minutils/s6ps_pwcache.c')
-rw-r--r--src/minutils/s6ps_pwcache.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/minutils/s6ps_pwcache.c b/src/minutils/s6ps_pwcache.c
index 4c78460..abee250 100644
--- a/src/minutils/s6ps_pwcache.c
+++ b/src/minutils/s6ps_pwcache.c
@@ -4,7 +4,6 @@
#include <pwd.h>
#include <errno.h>
#include <skalibs/uint.h>
-#include <skalibs/diuint.h>
#include <skalibs/stralloc.h>
#include <skalibs/genalloc.h>
#include <skalibs/skamisc.h>
@@ -23,18 +22,18 @@ int s6ps_pwcache_init (void)
void s6ps_pwcache_finish (void)
{
avltree_free(&pwcache_tree) ;
- genalloc_free(diuint, &pwcache_index) ;
+ genalloc_free(dius_t, &pwcache_index) ;
}
-int s6ps_pwcache_lookup (stralloc *sa, unsigned int uid)
+int s6ps_pwcache_lookup (stralloc *sa, uid_t uid)
{
int wasnull = !satmp.s ;
- diuint d = { .left = uid, .right = satmp.len } ;
+ dius_t d = { .left = (unsigned int)uid, .right = satmp.len } ;
unsigned int i ;
if (!avltree_search(&pwcache_tree, &d.left, &i))
{
struct passwd *pw ;
- unsigned int n = genalloc_len(diuint, &pwcache_index) ;
+ size_t n = genalloc_len(dius_t, &pwcache_index) ;
errno = 0 ;
pw = getpwuid(uid) ;
if (!pw)
@@ -49,7 +48,7 @@ int s6ps_pwcache_lookup (stralloc *sa, unsigned int uid)
if (!genalloc_append(diuint, &pwcache_index, &d)) goto err ;
if (!avltree_insert(&pwcache_tree, n))
{
- genalloc_setlen(diuint, &pwcache_index, n) ;
+ genalloc_setlen(dius_t, &pwcache_index, n) ;
goto err ;
}
i = n ;