Updated implementation.

2006-07-27  Benoît Dejean  <benoit@placenet.org>

	* netload.c: (glibtop_get_netload_s):

	Updated implementation.
This commit is contained in:
Benoît Dejean
2006-07-27 18:26:38 +00:00
committed by Benoît Dejean
parent c51a13bf0e
commit a7a9e7e9f8
2 changed files with 10 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2006-07-27 Benoît Dejean <benoit@placenet.org>
* netload.c: (glibtop_get_netload_s):
Updated implementation.
2006-07-27 Benoît Dejean <benoit@placenet.org>
* glibtop_private.c: (has_sysfs):

View File

@@ -500,6 +500,10 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST);
}
g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name);
if (!ioctl(skfd, /* SIOCGIWNAME */ 0x8B01, &ifr))
buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_WIRELESS);
g_strlcpy (ifr.ifr_name, interface, sizeof ifr.ifr_name);
if (!ioctl (skfd, SIOCGIFADDR, &ifr)) {
buf->address = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr;