Skip to content

Commit 0c5a950

Browse files
committed
FILE_PRINTF|SCANF: changing TWARN to TINFO
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 <[email protected]> Reviewed-by: Petr Vorel <[email protected]>
1 parent 391f69a commit 0c5a950

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/safe_file_ops.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int file_scanf(const char *file, const int lineno,
7676
f = fopen(path, "r");
7777

7878
if (f == NULL) {
79-
tst_resm_(file, lineno, TWARN, "Failed to open FILE '%s'",
79+
tst_resm_(file, lineno, TINFO, "Failed to open FILE '%s'",
8080
path);
8181
return 1;
8282
}
@@ -88,20 +88,20 @@ int file_scanf(const char *file, const int lineno,
8888
va_end(va);
8989

9090
if (ret == EOF) {
91-
tst_resm_(file, lineno, TWARN,
91+
tst_resm_(file, lineno, TINFO,
9292
"The FILE '%s' ended prematurely", path);
9393
goto err;
9494
}
9595

9696
if (ret != exp_convs) {
97-
tst_resm_(file, lineno, TWARN,
97+
tst_resm_(file, lineno, TINFO,
9898
"Expected %i conversions got %i FILE '%s'",
9999
exp_convs, ret, path);
100100
goto err;
101101
}
102102

103103
if (fclose(f)) {
104-
tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
104+
tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
105105
path);
106106
return 1;
107107
}
@@ -110,7 +110,7 @@ int file_scanf(const char *file, const int lineno,
110110

111111
err:
112112
if (fclose(f)) {
113-
tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
113+
tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
114114
path);
115115
}
116116

@@ -218,23 +218,23 @@ int file_printf(const char *file, const int lineno,
218218
f = fopen(path, "w");
219219

220220
if (f == NULL) {
221-
tst_resm_(file, lineno, TWARN, "Failed to open FILE '%s'",
221+
tst_resm_(file, lineno, TINFO, "Failed to open FILE '%s'",
222222
path);
223223
return 1;
224224
}
225225

226226
va_start(va, fmt);
227227

228228
if (vfprintf(f, fmt, va) < 0) {
229-
tst_resm_(file, lineno, TWARN, "Failed to print to FILE '%s'",
229+
tst_resm_(file, lineno, TINFO, "Failed to print to FILE '%s'",
230230
path);
231231
goto err;
232232
}
233233

234234
va_end(va);
235235

236236
if (fclose(f)) {
237-
tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
237+
tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
238238
path);
239239
return 1;
240240
}
@@ -243,7 +243,7 @@ int file_printf(const char *file, const int lineno,
243243

244244
err:
245245
if (fclose(f)) {
246-
tst_resm_(file, lineno, TWARN, "Failed to close FILE '%s'",
246+
tst_resm_(file, lineno, TINFO, "Failed to close FILE '%s'",
247247
path);
248248
}
249249

0 commit comments

Comments
 (0)