From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] FILE_PRINTF|SCANF: changing TWARN to TINFO
Date: Thu, 25 May 2023 16:09:33 +0800 [thread overview]
Message-ID: <20230525080934.54793-1-liwang@redhat.com> (raw)
There is no necessity to generate TWARN in unsafe marcos.
As we do have SAFE_FILE_PRINTF to break test on TBROK when
needed, so we should unify the behavior for LTP macro.
Signed-off-by: Li Wang <liwang@redhat.com>
---
lib/safe_file_ops.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/safe_file_ops.c b/lib/safe_file_ops.c
index f803691d8..63ae2dbbe 100644
--- a/lib/safe_file_ops.c
+++ b/lib/safe_file_ops.c
@@ -76,7 +76,7 @@ int file_scanf(const char *file, const int lineno,
f = fopen(path, "r");
if (f == NULL) {
- tst_resm_(file, lineno, TWARN, "Failed to open FILE '%s'",
+ tst_resm_(file, lineno, TINFO, "Failed to open FILE '%s'",
path);
return 1;
}
@@ -88,20 +88,20 @@ int file_scanf(const char *file, const int lineno,
va_end(va);
if (ret == EOF) {
- tst_resm_(file, lineno, TWARN,
+ tst_resm_(file, lineno, TINFO,
"The FILE '%s' ended prematurely", path);
goto err;
}
if (ret != exp_convs) {
- tst_resm_(file, lineno, TWARN,
+ tst_resm_(file, lineno, TINFO,
"Expected %i conversions got %i FILE '%s'",
exp_convs, ret, path);
goto err;
}
if (fclose(f)) {
- tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
+ tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
path);
return 1;
}
@@ -110,7 +110,7 @@ int file_scanf(const char *file, const int lineno,
err:
if (fclose(f)) {
- tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
+ tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
path);
}
@@ -218,7 +218,7 @@ int file_printf(const char *file, const int lineno,
f = fopen(path, "w");
if (f == NULL) {
- tst_resm_(file, lineno, TWARN, "Failed to open FILE '%s'",
+ tst_resm_(file, lineno, TINFO, "Failed to open FILE '%s'",
path);
return 1;
}
@@ -226,7 +226,7 @@ int file_printf(const char *file, const int lineno,
va_start(va, fmt);
if (vfprintf(f, fmt, va) < 0) {
- tst_resm_(file, lineno, TWARN, "Failed to print to FILE '%s'",
+ tst_resm_(file, lineno, TINFO, "Failed to print to FILE '%s'",
path);
goto err;
}
@@ -234,7 +234,7 @@ int file_printf(const char *file, const int lineno,
va_end(va);
if (fclose(f)) {
- tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
+ tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
path);
return 1;
}
@@ -243,7 +243,7 @@ int file_printf(const char *file, const int lineno,
err:
if (fclose(f)) {
- tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
+ tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
path);
}
--
2.40.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2023-05-25 8:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 8:09 Li Wang [this message]
2023-05-25 8:09 ` [LTP] [PATCH 2/2] cleanup: changing FILE_PRINTF to SAFE_FILE_PRINTF Li Wang
2023-05-26 14:25 ` Petr Vorel
2023-06-01 6:44 ` Li Wang
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=20230525080934.54793-1-liwang@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox