summary refs log tree commit diff
path: root/src/minutils/s6-ps.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/s6-ps.c
parent54d4b6e74bf539930db2cafbe075416894900076 (diff)
downloads6-linux-utils-59027c94f50a0d983a2bf0ebb72ef406b4fef20d.tar.gz
s6-linux-utils-59027c94f50a0d983a2bf0ebb72ef406b4fef20d.tar.xz
s6-linux-utils-59027c94f50a0d983a2bf0ebb72ef406b4fef20d.zip
Make sure avltree indices (in s6-ps) are uint32_t
Diffstat (limited to 'src/minutils/s6-ps.c')
-rw-r--r--src/minutils/s6-ps.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/minutils/s6-ps.c b/src/minutils/s6-ps.c
index c3d85fc..bba973b 100644
--- a/src/minutils/s6-ps.c
+++ b/src/minutils/s6-ps.c
@@ -2,6 +2,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <stdint.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
@@ -52,10 +53,10 @@ void *left_dtok (unsigned int d, void *x)
   return (void *)&genalloc_s(dius_t, (genalloc *)x)[d].left ;
 }
 
-int uint_cmp (void const *a, void const *b, void *x)
+int uint32_cmp (void const *a, void const *b, void *x)
 {
-  unsigned int aa = *(unsigned int *)a ;
-  unsigned int bb = *(unsigned int *)b ;
+  uint32_t aa = *(uint32_t *)a ;
+  uint32_t bb = *(uint32_t *)b ;
   (void)x ;
   return (aa < bb) ? -1 : (aa > bb) ;
 }
@@ -286,7 +287,7 @@ int main (int argc, char const *const *argv)
 
     {
       AVLTREEB_TYPE(n+1) pidtree ;
-      avltreeb_init(&pidtree, n+1, &pid_dtok, &uint_cmp, p) ;
+      avltreeb_init(&pidtree, n+1, &pid_dtok, &uint32_cmp, p) ;
       for (i = 0 ; i < n ; i++)
       {
         if (needstat && !s6ps_statparse(p+i))