* tests/test-getlogin.h (test_getlogin_result): According to source code of glibc, the type of /proc/self/loginuid is uid_t, which is unsigned int.
Signed-off-by: Letu Ren <fantasq...@gmail.com> --- tests/test-getlogin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-getlogin.h b/tests/test-getlogin.h index 3489e3e03..b5ed8b572 100644 --- a/tests/test-getlogin.h +++ b/tests/test-getlogin.h @@ -58,9 +58,9 @@ test_getlogin_result (const char *buf, int err) FILE *fp = fopen ("/proc/self/loginuid", "r"); if (fp != NULL) { - char buf[3]; + uid_t uid; loginuid_undefined = - (fread (buf, 1, 3, fp) == 2 && buf[0] == '-' && buf[1] == '1'); + (fscanf (fp, "%u", &uid) == 1 && uid == (uid_t) -1); fclose (fp); } if (loginuid_undefined) -- 2.36.1