Skip to content

Commit 747a71e

Browse files
higuoxingKernel Patches Daemon
authored andcommitted
selftests: arg_parsing: Ensure data is flushed to disk before reading.
Thanks for reviewing! Here's the revised patch.
1 parent 4b3a35b commit 747a71e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/testing/selftests/bpf/prog_tests/arg_parsing.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,11 @@ static void test_parse_test_list_file(void)
140140
fprintf(fp, "testA/subtest2\n");
141141
fprintf(fp, "testC_no_eof_newline");
142142
fflush(fp);
143-
144-
if (!ASSERT_OK(ferror(fp), "prepare tmp"))
145-
goto out_fclose;
143+
if (!ASSERT_OK(ferror(fp), "prepare tmp")) {
144+
fclose(fp);
145+
goto out_remove;
146+
}
147+
fclose(fp);
146148

147149
init_test_filter_set(&set);
148150

@@ -160,8 +162,6 @@ static void test_parse_test_list_file(void)
160162

161163
free_test_filter_set(&set);
162164

163-
out_fclose:
164-
fclose(fp);
165165
out_remove:
166166
remove(tmpfile);
167167
}

0 commit comments

Comments
 (0)