mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
pkt-loop-filter: Provide file mode for open() call
This is needed when opening with O_CREAT. Reported-by: Simon Sundberg <Simon.Sundberg@kau.se> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
This commit is contained in:
@@ -125,7 +125,7 @@ int fork_and_wait(struct bpf_link *trace_link, int ifindex)
|
||||
|
||||
fprintf(stderr, "Forked pid %d.\n", pid);
|
||||
|
||||
fd = open(pid_path, O_CREAT|O_EXCL|O_WRONLY);
|
||||
fd = open(pid_path, O_CREAT|O_EXCL|O_WRONLY, 0600);
|
||||
if (fd < 0) {
|
||||
err = -errno;
|
||||
fprintf(stderr, "Couldn't open file %s for writing: %s\n",
|
||||
|
||||
Reference in New Issue
Block a user