mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-21 06:45:29 -06:00
fnetlock: fix unused bw variable warning
This is breaking build-clang on CI[1]:
make -C src/fnetlock/
make[1]: Entering directory '/home/runner/work/firejail/firejail/src/fnetlock'
clang-14 [...] -c main.c -o main.o
main.c:97:11: error: variable 'bw' set but not used [-Werror,-Wunused-but-set-variable]
unsigned bw = 0; // bandwidth calculations
^
1 error generated.
make[1]: *** [../../src/prog.mk:16: main.o] Error 1
make: *** [Makefile:58: src/fnetlock/fnetlock] Error 2
Added on commit 8e4b847cd ("split nettrace executable ^Cto netrace and
netlock", 2023-07-25).
[1]: https://github.com/netblue30/firejail/actions/runs/5669072674/job/15361026508
Cc: @netblue30
This commit is contained in:
parent
6d4bb95948
commit
16dc7448ca
1 changed files with 4 additions and 2 deletions
|
|
@ -94,7 +94,8 @@ static void run_trace(void) {
|
|||
|
||||
unsigned start = time(NULL);
|
||||
unsigned char buf[MAX_BUF_SIZE];
|
||||
unsigned bw = 0; // bandwidth calculations
|
||||
// FIXME: error: variable 'bw' set but not used [-Werror,-Wunused-but-set-variable]
|
||||
//unsigned bw = 0; // bandwidth calculations
|
||||
|
||||
int printed = 0;
|
||||
while (1) {
|
||||
|
|
@ -149,7 +150,8 @@ static void run_trace(void) {
|
|||
#endif
|
||||
// filter out loopback traffic
|
||||
if (buf[12] != 127 && buf[16] != 127) {
|
||||
bw += bytes + 14; // assume a 14 byte Ethernet layer
|
||||
// FIXME: error: variable 'bw' set but not used [-Werror,-Wunused-but-set-variable]
|
||||
//bw += bytes + 14; // assume a 14 byte Ethernet layer
|
||||
|
||||
uint32_t ip_src;
|
||||
memcpy(&ip_src, buf + 12, 4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue