aboutsummaryrefslogtreecommitdiffstats
path: root/src/firemon
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2021-06-03 18:26:31 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2021-06-18 14:48:56 -0300
commit31557e9c770d9da7199a64f40f17f50a6686bcb1 (patch)
treec172939c5548c05409caf42955ba015a98480d53 /src/firemon
parentappimage: automatically detect profile (diff)
downloadfirejail-31557e9c770d9da7199a64f40f17f50a6686bcb1.tar.gz
firejail-31557e9c770d9da7199a64f40f17f50a6686bcb1.tar.zst
firejail-31557e9c770d9da7199a64f40f17f50a6686bcb1.zip
gcov: add missing gcov.h includes
Fixes the following "implicit declaration" warning (13 occurrences in total) when building with gcov support: $ pacman -Q gcc10 gcc10 1:10.2.0-3 $ CC=gcc-10 && export CC $ ./configure --prefix=/usr --enable-apparmor --enable-gcov >/dev/null $ make >/dev/null appimage.c: In function ‘appimage_set’: appimage.c:140:2: warning: implicit declaration of function ‘__gcov_flush’ [-Wimplicit-function-declaration] 140 | __gcov_flush(); | ^~~~~~~~~~~~ interface.c: In function ‘print_sandbox’: interface.c:149:3: warning: implicit declaration of function ‘__gcov_flush’ [-Wimplicit-function-declaration] 149 | __gcov_flush(); | ^~~~~~~~~~~~ netstats.c: In function ‘netstats’: netstats.c:246:4: warning: implicit declaration of function ‘__gcov_flush’ [-Wimplicit-function-declaration] 246 | __gcov_flush(); | ^~~~~~~~~~~~ [...] Note: The commands above were executed from makepkg, while building firejail-git from the AUR. Note2: gcc-10 was used because the build fails with the current gcc version (11.1.0) on Artix Linux. The failure happens because __gcov_flush was removed on gcc 11.1.0[1]; this will be addressed later. Note3: The following command helped find the affected files: $ git grep -Fl __gcov -- src [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=811b7636cb8c10f1a550a76242b5666c7ae36da2
Diffstat (limited to 'src/firemon')
-rw-r--r--src/firemon/interface.c4
-rw-r--r--src/firemon/netstats.c4
-rw-r--r--src/firemon/procevent.c4
-rw-r--r--src/firemon/top.c4
4 files changed, 16 insertions, 0 deletions
diff --git a/src/firemon/interface.c b/src/firemon/interface.c
index e04b6f431..b93d4a5a2 100644
--- a/src/firemon/interface.c
+++ b/src/firemon/interface.c
@@ -33,6 +33,10 @@
33//#include <net/route.h> 33//#include <net/route.h>
34//#include <linux/if_bridge.h> 34//#include <linux/if_bridge.h>
35 35
36#ifdef HAVE_GCOV
37#include <gcov.h>
38#endif
39
36// print IP addresses for all interfaces 40// print IP addresses for all interfaces
37static void net_ifprint(void) { 41static void net_ifprint(void) {
38 uint32_t ip; 42 uint32_t ip;
diff --git a/src/firemon/netstats.c b/src/firemon/netstats.c
index 850959eb3..23d228e26 100644
--- a/src/firemon/netstats.c
+++ b/src/firemon/netstats.c
@@ -24,6 +24,10 @@
24#include <sys/stat.h> 24#include <sys/stat.h>
25#include <unistd.h> 25#include <unistd.h>
26 26
27#ifdef HAVE_GCOV
28#include <gcov.h>
29#endif
30
27#define MAXBUF 4096 31#define MAXBUF 4096
28 32
29// ip -s link: device stats 33// ip -s link: device stats
diff --git a/src/firemon/procevent.c b/src/firemon/procevent.c
index 8085d2d29..4e809681e 100644
--- a/src/firemon/procevent.c
+++ b/src/firemon/procevent.c
@@ -30,6 +30,10 @@
30#include <fcntl.h> 30#include <fcntl.h>
31#include <sys/uio.h> 31#include <sys/uio.h>
32 32
33#ifdef HAVE_GCOV
34#include <gcov.h>
35#endif
36
33#define PIDS_BUFLEN 4096 37#define PIDS_BUFLEN 4096
34#define SERVER_PORT 889 // 889-899 is left unassigned by IANA 38#define SERVER_PORT 889 // 889-899 is left unassigned by IANA
35 39
diff --git a/src/firemon/top.c b/src/firemon/top.c
index a25e3c0d8..9d6f34991 100644
--- a/src/firemon/top.c
+++ b/src/firemon/top.c
@@ -24,6 +24,10 @@
24#include <sys/stat.h> 24#include <sys/stat.h>
25#include <unistd.h> 25#include <unistd.h>
26 26
27#ifdef HAVE_GCOV
28#include <gcov.h>
29#endif
30
27static unsigned pgs_rss = 0; 31static unsigned pgs_rss = 0;
28static unsigned pgs_shared = 0; 32static unsigned pgs_shared = 0;
29static unsigned clocktick = 0; 33static unsigned clocktick = 0;