tools/nolibc: sys: avoid implicit sign cast
authorThomas Weißschuh <linux@weissschuh.net>
Thu, 3 Aug 2023 07:28:48 +0000 (09:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2023 03:17:07 +0000 (05:17 +0200)
getauxval() returns an unsigned long but the overall type of the ternary
operator needs to be signed.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/include/nolibc/sys.h

index c151533..833d6c5 100644 (file)
@@ -466,7 +466,7 @@ static unsigned long getauxval(unsigned long key);
 static __attribute__((unused))
 int getpagesize(void)
 {
-       return __sysret(getauxval(AT_PAGESZ) ?: -ENOENT);
+       return __sysret((int)getauxval(AT_PAGESZ) ?: -ENOENT);
 }