From: lufei <lufei@uniontech.com>
To: ltp@lists.linux.it
Cc: lufei <lufei@uniontech.com>
Subject: [LTP] [PATCH] acct: fix make check errors: using .needs_kconfigs
Date: Mon, 24 Jun 2024 09:54:32 +0800 [thread overview]
Message-ID: <20240624015432.54985-1-lufei@uniontech.com> (raw)
In-Reply-To: <20240606065506.1686-1-lufei@uniontech.com>
fix make check errors and warnings. Using .needs_kconfigs instead of ENOSYS.
Signed-off-by: lufei <lufei@uniontech.com>
---
testcases/kernel/syscalls/acct/acct01.c | 18 ++++++++----------
testcases/kernel/syscalls/acct/acct02.c | 2 +-
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
index a05ed2ea9..1b53a32f2 100644
--- a/testcases/kernel/syscalls/acct/acct01.c
+++ b/testcases/kernel/syscalls/acct/acct01.c
@@ -25,8 +25,7 @@
#include "tst_test.h"
-#define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
- S_IXGRP|S_IROTH|S_IXOTH)
+#define DIR_MODE 0755
#define FILE_EISDIR "."
#define FILE_EACCESS "/dev/null"
#define FILE_ENOENT "/tmp/does/not/exist"
@@ -61,8 +60,8 @@ static struct test_case {
char **filename;
char *desc;
int exp_errno;
- void (*setupfunc) ();
- void (*cleanfunc) ();
+ void (*setupfunc)();
+ void (*cleanfunc)();
} tcases[] = {
{&file_eisdir, FILE_EISDIR, EISDIR, NULL, NULL},
{&file_eaccess, FILE_EACCESS, EACCES, NULL, NULL},
@@ -79,10 +78,6 @@ static void setup(void)
{
int fd;
- TEST(acct(NULL));
- if (TST_RET == -1 && TST_ERR == ENOSYS)
- tst_brk(TCONF, "acct() system call isn't configured in kernel");
-
ltpuser = SAFE_GETPWNAM("nobody");
fd = SAFE_CREAT(FILE_TMPFILE, 0777);
@@ -113,7 +108,7 @@ static void verify_acct(unsigned int nr)
tcase->setupfunc();
TST_EXP_FAIL(acct(*tcase->filename), tcase->exp_errno,
- "acct(%s)", tcase->desc);
+ "acct(%s)", tcase->desc);
if (tcase->cleanfunc)
tcase->cleanfunc();
@@ -136,5 +131,8 @@ static struct tst_test test = {
{&file_enametoolong, .size = PATH_MAX+2},
{&file_erofs, .str = FILE_EROFS},
{}
- }
+ },
+ .needs_kconfigs = (const char *[]) {
+ "CONFIG_BSD_PROCESS_ACCT=y",
+ },
};
diff --git a/testcases/kernel/syscalls/acct/acct02.c b/testcases/kernel/syscalls/acct/acct02.c
index d3f3d9d04..74019f430 100644
--- a/testcases/kernel/syscalls/acct/acct02.c
+++ b/testcases/kernel/syscalls/acct/acct02.c
@@ -186,7 +186,7 @@ static void run(void)
if (read_bytes != acct_size) {
tst_res(TFAIL, "incomplete read %i bytes, expected %i",
- read_bytes, acct_size);
+ read_bytes, acct_size);
goto exit;
}
--
2.39.3
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-06-24 1:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 6:55 [LTP] [PATCH] acct01: add EFAULT errno check lufei
2024-06-21 12:00 ` Petr Vorel
[not found] ` <20240624015245.54968-1-lufei@uniontech.com>
2024-06-24 1:52 ` lufei
2024-07-08 4:23 ` Petr Vorel
2024-07-08 5:31 ` 路斐
2024-07-08 8:54 ` Petr Vorel
2024-07-29 22:44 ` Petr Vorel
2024-06-24 1:54 ` lufei [this message]
2024-07-04 13:29 ` Cyril Hrubis
2024-07-05 2:02 ` 路斐
2024-07-08 8:56 ` Cyril Hrubis
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=20240624015432.54985-1-lufei@uniontech.com \
--to=lufei@uniontech.com \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox