Skip to content

Commit f48ad69

Browse files
Andrea Righiborkmann
authored andcommitted
selftests/bpf: Fix fclose/pclose mismatch in test_progs
Make sure to use pclose() to properly close the pipe opened by popen(). Fixes: 81f77fd ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID") Signed-off-by: Andrea Righi <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Shuah Khan <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent b9989b5 commit f48ad69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/bpf/test_progs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ int extract_build_id(char *build_id, size_t size)
382382

383383
if (getline(&line, &len, fp) == -1)
384384
goto err;
385-
fclose(fp);
385+
pclose(fp);
386386

387387
if (len > size)
388388
len = size;
@@ -391,7 +391,7 @@ int extract_build_id(char *build_id, size_t size)
391391
free(line);
392392
return 0;
393393
err:
394-
fclose(fp);
394+
pclose(fp);
395395
return -1;
396396
}
397397

0 commit comments

Comments
 (0)