Skip to content

Commit

Permalink
reboot: add unsinged declaration
Browse files Browse the repository at this point in the history
To get rid of warns in compiling, I should fix it in code review
but forget to submit it when pushing.

Signed-off-by: Li Wang <liwang@redhat.com>
  • Loading branch information
wangli5665 committed Apr 28, 2021
1 parent cf648a8 commit b71b1a4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions testcases/kernel/syscalls/reboot/reboot02.c
Expand Up @@ -31,7 +31,7 @@
char nobody_uid[] = "nobody";
struct passwd *ltpuser;

static struct test_case_t {
static struct tcase {
int flag;
int exp_errno;
const char *option_message;
Expand All @@ -40,19 +40,19 @@ static struct test_case_t {
{LINUX_REBOOT_CMD_CAD_ON, EPERM, "LINUX_REBOOT_CMD_CAD_ON"},
};

static void run(int n)
static void run(unsigned int n)
{
struct test_case_t *tcase = &tcases[n];
struct tcase *tc = &tcases[n];

if (n == 0)
TST_EXP_FAIL(reboot(tcase->flag),
tcase->exp_errno, "%s", tcase->option_message);
TST_EXP_FAIL(reboot(tc->flag),
tc->exp_errno, "%s", tc->option_message);
else {
ltpuser = SAFE_GETPWNAM(nobody_uid);
SAFE_SETEUID(ltpuser->pw_uid);

TST_EXP_FAIL(reboot(tcase->flag),
tcase->exp_errno, "%s", tcase->option_message);
TST_EXP_FAIL(reboot(tc->flag),
tc->exp_errno, "%s", tc->option_message);

SAFE_SETEUID(0);
}
Expand Down

0 comments on commit b71b1a4

Please sign in to comment.