diff options
Diffstat (limited to 'src/firemon/procevent.c')
-rw-r--r-- | src/firemon/procevent.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/firemon/procevent.c b/src/firemon/procevent.c index e2dd5aaa2..edae21951 100644 --- a/src/firemon/procevent.c +++ b/src/firemon/procevent.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <arpa/inet.h> | 28 | #include <arpa/inet.h> |
29 | #include <time.h> | 29 | #include <time.h> |
30 | #include <fcntl.h> | 30 | #include <fcntl.h> |
31 | #include <sys/uio.h> | ||
32 | |||
31 | #define PIDS_BUFLEN 4096 | 33 | #define PIDS_BUFLEN 4096 |
32 | #define SERVER_PORT 889 // 889-899 is left unassigned by IANA | 34 | #define SERVER_PORT 889 // 889-899 is left unassigned by IANA |
33 | 35 | ||
@@ -41,10 +43,8 @@ static int pid_is_firejail(pid_t pid) { | |||
41 | 43 | ||
42 | // open /proc/self/comm | 44 | // open /proc/self/comm |
43 | char *file; | 45 | char *file; |
44 | if (asprintf(&file, "/proc/%u/comm", pid) == -1) { | 46 | if (asprintf(&file, "/proc/%u/comm", pid) == -1) |
45 | perror("asprintf"); | 47 | errExit("asprintf"); |
46 | exit(1); | ||
47 | } | ||
48 | 48 | ||
49 | FILE *fp = fopen(file, "r"); | 49 | FILE *fp = fopen(file, "r"); |
50 | if (!fp) { | 50 | if (!fp) { |
@@ -89,7 +89,8 @@ static int pid_is_firejail(pid_t pid) { | |||
89 | 89 | ||
90 | // list of firejail arguments that don't trigger sandbox creation | 90 | // list of firejail arguments that don't trigger sandbox creation |
91 | // the initial -- is not included | 91 | // the initial -- is not included |
92 | char *firejail_args = "ls list tree x11 help version top netstats debug-syscalls debug-errnos debug-protocols"; | 92 | char *firejail_args = "ls list tree x11 help version top netstats debug-syscalls debug-errnos debug-protocols " |
93 | "protocol.print debug.caps shutdown bandwidth caps.print cpu.print debug-caps fs.print get overlay-clean "; | ||
93 | 94 | ||
94 | int i; | 95 | int i; |
95 | char *start; | 96 | char *start; |
@@ -189,6 +190,10 @@ static int procevent_monitor(const int sock, pid_t mypid) { | |||
189 | tv.tv_usec = 0; | 190 | tv.tv_usec = 0; |
190 | 191 | ||
191 | while (1) { | 192 | while (1) { |
193 | #ifdef HAVE_GCOV | ||
194 | __gcov_flush(); | ||
195 | #endif | ||
196 | |||
192 | #define BUFFSIZE 4096 | 197 | #define BUFFSIZE 4096 |
193 | char __attribute__ ((aligned(NLMSG_ALIGNTO)))buf[BUFFSIZE]; | 198 | char __attribute__ ((aligned(NLMSG_ALIGNTO)))buf[BUFFSIZE]; |
194 | 199 | ||