summaryrefslogtreecommitdiff
path: root/src/minutils/s6ps_ttycache.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-03-27 12:12:42 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-03-27 12:12:42 +0000
commit59027c94f50a0d983a2bf0ebb72ef406b4fef20d (patch)
tree18a2e2e1945ffd3d673c1bdc25b76d93dcf317d5 /src/minutils/s6ps_ttycache.c
parent54d4b6e74bf539930db2cafbe075416894900076 (diff)
downloads6-linux-utils-59027c94f50a0d983a2bf0ebb72ef406b4fef20d.tar.xz
Make sure avltree indices (in s6-ps) are uint32_t
Diffstat (limited to 'src/minutils/s6ps_ttycache.c')
-rw-r--r--src/minutils/s6ps_ttycache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/minutils/s6ps_ttycache.c b/src/minutils/s6ps_ttycache.c
index df59334..7fa4bc0 100644
--- a/src/minutils/s6ps_ttycache.c
+++ b/src/minutils/s6ps_ttycache.c
@@ -5,6 +5,7 @@
#endif
#include <string.h>
+#include <stdint.h>
#include <sys/stat.h>
#include <errno.h>
#include <skalibs/types.h>
@@ -22,7 +23,7 @@ static genalloc ttycache_index = GENALLOC_ZERO ;
int s6ps_ttycache_init (void)
{
- avltree_init(&ttycache_tree, 5, 3, 8, &left_dtok, &uint_cmp, &ttycache_index) ;
+ avltree_init(&ttycache_tree, 5, 3, 8, &left_dtok, &uint32_cmp, &ttycache_index) ;
return 1 ;
}
@@ -112,8 +113,8 @@ static int ttyguess (stralloc *sa, dev_t ttynr)
int s6ps_ttycache_lookup (stralloc *sa, dev_t ttynr)
{
int wasnull = !satmp.s ;
- dius_t d = { .left = (unsigned int)ttynr, .right = satmp.len } ;
- unsigned int i ;
+ dius_t d = { .left = (uint32_t)ttynr, .right = satmp.len } ;
+ uint32_t i ;
if (!avltree_search(&ttycache_tree, &d.left, &i))
{
unsigned int n = genalloc_len(dius_t, &ttycache_index) ;