Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kernel-patches/bpf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5725bc8f3a55a684172a8a185e77b88d3a63d124
Choose a base ref
..
head repository: kernel-patches/bpf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: da616f9752d76db01901a3ec44c28506eaf8bc96
Choose a head ref
Showing with 3 additions and 2 deletions.
  1. +3 −2 tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c
5 changes: 3 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
#include <linux/unistd.h>
#include <linux/mount.h>
#include <sys/syscall.h>
#include "bpf/libbpf_internal.h"

static inline int sys_fsopen(const char *fsname, unsigned flags)
{
@@ -155,7 +156,7 @@ static void validate_pin(int map_fd, const char *map_name, int src_value,
ASSERT_OK(err, "obj_pin");

/* cleanup */
if (pin_opts.path_fd >= 0)
if (path_kind == PATH_FD_REL && pin_opts.path_fd >= 0)
close(pin_opts.path_fd);
if (old_cwd[0])
ASSERT_OK(chdir(old_cwd), "restore_cwd");
@@ -220,7 +221,7 @@ static void validate_get(int map_fd, const char *map_name, int src_value,
goto cleanup;

/* cleanup */
if (get_opts.path_fd >= 0)
if (path_kind == PATH_FD_REL && get_opts.path_fd >= 0)
close(get_opts.path_fd);
if (old_cwd[0])
ASSERT_OK(chdir(old_cwd), "restore_cwd");