Skip to content

Commit fe2cc4e

Browse files
thefallentreeNobody
authored and
Nobody
committed
selftests/bpf: variable naming fix
Change log_fd to log_fp to reflect its type correctly. Signed-off-by: Yucong Sun <[email protected]>
1 parent 9377988 commit fe2cc4e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/testing/selftests/bpf/test_progs.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ static void *dispatch_thread(void *ctx)
939939
{
940940
struct dispatch_data *data = ctx;
941941
int sock_fd;
942-
FILE *log_fd = NULL;
942+
FILE *log_fp = NULL;
943943

944944
sock_fd = data->sock_fd;
945945

@@ -1002,8 +1002,8 @@ static void *dispatch_thread(void *ctx)
10021002

10031003
/* collect all logs */
10041004
if (msg_test_done.test_done.have_log) {
1005-
log_fd = open_memstream(&result->log_buf, &result->log_cnt);
1006-
if (!log_fd)
1005+
log_fp = open_memstream(&result->log_buf, &result->log_cnt);
1006+
if (!log_fp)
10071007
goto error;
10081008

10091009
while (true) {
@@ -1014,12 +1014,12 @@ static void *dispatch_thread(void *ctx)
10141014
if (msg_log.type != MSG_TEST_LOG)
10151015
goto error;
10161016

1017-
fprintf(log_fd, "%s", msg_log.test_log.log_buf);
1017+
fprintf(log_fp, "%s", msg_log.test_log.log_buf);
10181018
if (msg_log.test_log.is_last)
10191019
break;
10201020
}
1021-
fclose(log_fd);
1022-
log_fd = NULL;
1021+
fclose(log_fp);
1022+
log_fp = NULL;
10231023
}
10241024
/* output log */
10251025
{
@@ -1045,8 +1045,8 @@ static void *dispatch_thread(void *ctx)
10451045
if (env.debug)
10461046
fprintf(stderr, "[%d]: Protocol/IO error: %s.\n", data->worker_id, strerror(errno));
10471047

1048-
if (log_fd)
1049-
fclose(log_fd);
1048+
if (log_fp)
1049+
fclose(log_fp);
10501050
done:
10511051
{
10521052
struct msg msg_exit;

0 commit comments

Comments
 (0)