aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/seccomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/seccomp.c')
-rw-r--r--src/firejail/seccomp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/firejail/seccomp.c b/src/firejail/seccomp.c
index 3d9bf9082..e02be29f1 100644
--- a/src/firejail/seccomp.c
+++ b/src/firejail/seccomp.c
@@ -435,11 +435,11 @@ void seccomp_print_filter(pid_t pid) {
435 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_SECCOMP_LIST) == -1) 435 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_SECCOMP_LIST) == -1)
436 errExit("asprintf"); 436 errExit("asprintf");
437 437
438 struct stat s; 438 int fd = open(fname, O_RDONLY|O_CLOEXEC);
439 if (stat(fname, &s) == -1) 439 if (fd < 0)
440 goto errexit; 440 goto errexit;
441 441
442 FILE *fp = fopen(fname, "re"); 442 FILE *fp = fdopen(fd, "r");
443 if (!fp) 443 if (!fp)
444 goto errexit; 444 goto errexit;
445 free(fname); 445 free(fname);