Source: libsysactivity
Source-Version: 0.6.2-6
Severity: important
Tags: patch

Hi!

While rebuilding packages for the new libbsd 0.4.0 upload, this package
fails to build consistently on at least my system, and it might seem
like on at least the mips buildd too, I've not investigated in detail
what exactly is triggering this only on these systems and not others,
but I think it's due to me having 3 network interfaces (lo, eth0, wlan0),
in any case there's a bogus fflush() on an input stream which is causing
wrong subsequent fseek()s. The behaviour of fflush() in input streams is
not usually well defined and in this case is not really needed, fseek()
should just do fine.

Attached a patch fixing this. And here's the failure mode:

,---
test 3
    Start 3: network

3: Test command: «BUILDPATH»/libsysactivity-0.6.2/build/test/network
3: Test timeout computed to be: 9.99988e+06
3: lo
3:  received: 1043482 bytes, 13242 packets, 0 errors, 0 dropped, 0 fifo, 
3:  sent: 1043482 bytes, 13242 packets, 0 errors, 0 dropped, 0 fifo, 
3: 
3: There are 2 network interfaces
3: «BUILDPATH»/libsysactivity-0.6.2/test/test_network.c:153 ERROR: 
sa_get_net_interfaces_ids(): Cannot allocate memory
3/4 Test #3: network ..........................***Failed    0.00 sec
`---

thanks,
guillem
diff --git a/src/Linux/network.c b/src/Linux/network.c
index 11051c8..228737a 100644
--- a/src/Linux/network.c
+++ b/src/Linux/network.c
@@ -76,8 +76,6 @@ int sa_count_net_interfaces(uint16_t* number) {
 }
 
 int sa_reset_net_interfaces() {
-	if (fflush(file_net_dev) != 0)
-		return EIO;
 	fseek(file_net_dev, pos_useful_data, SEEK_SET);
 	return 0;
 }

Reply via email to