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:
Toke Høiland-Jørgensen
2022-11-16 15:29:57 +01:00
parent a678c703fc
commit ac03d27590
+1 -1
View File
@@ -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",