All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/reboot: Update to new API
Date: Wed, 28 Apr 2021 19:05:47 +0800	[thread overview]
Message-ID: <CAEemH2cai9qNXiqq=MDi4KOo=2ZjiBxD2SssCT=vVp7F+qgDQA@mail.gmail.com> (raw)
In-Reply-To: <CAEemH2d8PK2uz9QpYefmhoaLm=g9NwsViUGMB=pJ4f0PKtSAvw@mail.gmail.com>

> Nice work on API converting and cleanup, pushed!

BTW, I made some modifications in a separate patch[1], because
I forget to submit them in the last code-reviewing.

https://github.com/linux-test-project/ltp/commit/b71b1a494be4126917221bb3b78594ec25c71ea0

--- a/testcases/kernel/syscalls/reboot/reboot02.c
+++ b/testcases/kernel/syscalls/reboot/reboot02.c
@@ -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;
@@ -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);
        }


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210428/56d550e4/attachment-0001.htm>

      reply	other threads:[~2021-04-28 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  3:10 [LTP] [PATCH] syscalls/reboot: Update to new API Zhao Gongyi
2021-04-28 10:51 ` Li Wang
2021-04-28 11:05   ` Li Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEemH2cai9qNXiqq=MDi4KOo=2ZjiBxD2SssCT=vVp7F+qgDQA@mail.gmail.com' \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.