tests: improve setugid error diagnostics a bit
* tests/setugid.c (main): Print unexpected code returned by syscall.
This commit is contained in:
parent
457ad95b7f
commit
b3d691efe4
@ -61,6 +61,8 @@ main(void)
|
|||||||
const unsigned int num = (unsigned UGID_TYPE) tests[i];
|
const unsigned int num = (unsigned UGID_TYPE) tests[i];
|
||||||
long expected;
|
long expected;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
|
||||||
if (num == ugid)
|
if (num == ugid)
|
||||||
expected = 0;
|
expected = 0;
|
||||||
else if ((UGID_TYPE) num == (UGID_TYPE) -1U)
|
else if ((UGID_TYPE) num == (UGID_TYPE) -1U)
|
||||||
@ -77,8 +79,9 @@ main(void)
|
|||||||
SYSCALL_NAME, ugid, errstr);
|
SYSCALL_NAME, ugid, errstr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
perror_msg_and_fail("%s(%#lx) != %ld",
|
perror_msg_and_fail("%s(%#lx) = %ld != %ld",
|
||||||
SYSCALL_NAME, tests[i], expected);
|
SYSCALL_NAME, tests[i],
|
||||||
|
rc, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s(", SYSCALL_NAME);
|
printf("%s(", SYSCALL_NAME);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user