Skip to content

Commit

Permalink
libbpf-tools: fix tcpconnect compile errors
Browse files Browse the repository at this point in the history
Signed-off-by: Wenbo Zhang <[email protected]>
  • Loading branch information
ethercflow authored and yonghong-song committed Aug 2, 2020
1 parent e0e2215 commit f8ac3c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libbpf-tools/maps.bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define __MAPS_BPF_H

#include <bpf/bpf_helpers.h>
#include <errno.h>
#include <asm-generic/errno.h>

static __always_inline void *
bpf_map_lookup_or_try_init(void *map, const void *key, const void *init)
Expand Down
8 changes: 4 additions & 4 deletions libbpf-tools/tcpconnect.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include "maps.bpf.h"
#include "tcpconnect.h"

const volatile bool do_count;
const volatile int filter_ports_len;
const volatile int filter_ports[MAX_PORTS];
const volatile pid_t filter_pid;
SEC(".rodata") int filter_ports[MAX_PORTS];
const volatile int filter_ports_len = 0;
const volatile uid_t filter_uid = -1;
const volatile pid_t filter_pid = 0;
const volatile bool do_count = 0;

/* Define here, because there are conflicts with include files */
#define AF_INET 2
Expand Down
2 changes: 1 addition & 1 deletion libbpf-tools/tcpconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static void print_events(int perf_map_fd)
print_events_header();
while (hang_on) {
err = perf_buffer__poll(pb, 100);
if (err < 0) {
if (err < 0 && errno != EINTR) {
warn("Error polling perf buffer: %d\n", err);
goto cleanup;
}
Expand Down

0 comments on commit f8ac3c6

Please sign in to comment.