summaryrefslogtreecommitdiff
path: root/net/netspeed_applet/files
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2008-02-25 19:30:30 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2008-02-25 19:30:30 +0000
commit630bb050bff9f308e57a9f9e5661a109d47decab (patch)
tree74f055fce17453c1f504d2a8bbcf1c64e643e892 /net/netspeed_applet/files
parentUpdate to 0.9.9. (diff)
Update to 0.14.
Diffstat (limited to 'net/netspeed_applet/files')
-rw-r--r--net/netspeed_applet/files/patch-src_backend.c56
-rw-r--r--net/netspeed_applet/files/patch-src_netspeed.c48
2 files changed, 12 insertions, 92 deletions
diff --git a/net/netspeed_applet/files/patch-src_backend.c b/net/netspeed_applet/files/patch-src_backend.c
deleted file mode 100644
index 041a6d941efd..000000000000
--- a/net/netspeed_applet/files/patch-src_backend.c
+++ /dev/null
@@ -1,56 +0,0 @@
---- src/backend.c.orig Wed May 3 02:41:00 2006
-+++ src/backend.c Wed May 3 03:03:09 2006
-@@ -20,6 +20,7 @@
- #include <config.h>
- #include <glibtop/netlist.h>
- #include <glibtop/netload.h>
-+#include <net/if_media.h>
- #include "backend.h"
-
- /* Check for all available devices. This really should be
-@@ -131,7 +132,7 @@
-
- g_strlcpy(request.ifr_name, devinfo->name, sizeof request.ifr_name);
-
-- if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
-+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
- goto out;
-
- if (ioctl(fd, SIOCGIFFLAGS, &request) == -1)
-@@ -148,16 +149,20 @@
- }
- }
-
-+ if (devinfo->type == DEV_UNKNOWN) {
-+ struct ifmediareq ifmr;
-
-- if (ioctl(fd, SIOCGIWNAME, &request) >= 0) {
-- devinfo->type = DEV_WIRELESS;
-- }
-+ memset(&ifmr, 0, sizeof(ifmr));
-+ g_strlcpy(ifmr.ifm_name, devinfo->name, sizeof(ifmr.ifm_name));
-
-- if (ioctl(fd, SIOCGIWENCODE, &request) >= 0) {
-- g_assert_not_reached();
-+ if (ioctl(fd, SIOCGIFMEDIA, &ifmr) >= 0) {
-+ switch (IFM_TYPE(ifmr.ifm_current)) {
-+ case IFM_ETHER: devinfo->type = DEV_ETHERNET; break;
-+ case IFM_IEEE80211: devinfo->type = DEV_WIRELESS; break;
-+ }
-+ }
- }
-
--
- out:
- if(fd != -1)
- close(fd);
-@@ -210,9 +215,6 @@
- else {
- devinfo.type = DEV_PPP;
- }
-- }
-- else if (g_str_has_prefix(device, "eth")) {
-- devinfo.type = DEV_ETHERNET;
- }
-
- get_additional_info(&devinfo);
diff --git a/net/netspeed_applet/files/patch-src_netspeed.c b/net/netspeed_applet/files/patch-src_netspeed.c
index 580d2bdd79f9..11baff12d0d0 100644
--- a/net/netspeed_applet/files/patch-src_netspeed.c
+++ b/net/netspeed_applet/files/patch-src_netspeed.c
@@ -1,5 +1,5 @@
---- src/netspeed.c.orig Mon May 1 19:36:46 2006
-+++ src/netspeed.c Mon May 1 19:42:28 2006
+--- src/netspeed.c.orig 2006-09-28 05:54:52.000000000 -0400
++++ src/netspeed.c 2008-02-25 14:24:13.000000000 -0500
@@ -23,6 +23,7 @@
#include <panel-applet.h>
#include <panel-applet-gconf.h>
@@ -8,45 +8,21 @@
#include "backend.h"
#include "netspeed.h"
-@@ -391,7 +392,7 @@
-
- devices = get_available_devices();
- for (tmp = devices; tmp; tmp = g_list_next(tmp)) {
-- if (strcmp(tmp->data, "lo") == 0) continue;
-+ if (strcmp(tmp->data, "lo0") == 0) continue;
- if (strncmp(tmp->data, "dummy", strlen("dummy")) == 0) continue;
- info = get_device_info(tmp->data);
- if (info.running) {
-@@ -1344,6 +1345,16 @@
- if (strcmp (iid, "OAFIID:GNOME_NetspeedApplet"))
- return FALSE;
-
-+ /*
-+ * Work around a design flaw in libgtop: force an initialisation
-+ * of the server, otherwise glibtop_get_netlist() will find that
-+ * the server is not needed and glibtop_get_netload() (which needs
-+ * the server) will fail.
-+ *
-+ * Jean-Yves Lefort <jylefort@FreeBSD.org> 20060501
-+ */
-+ glibtop_init();
-+
- icon_theme = gtk_icon_theme_get_default();
- gtk_icon_theme_append_search_path(icon_theme, DATADIR"/pixmaps/"PACKAGE);
-
-@@ -1432,13 +1443,13 @@
+@@ -1493,7 +1494,7 @@ netspeed_applet_factory(PanelApplet *app
GList *ptr, *devices = get_available_devices();
ptr = devices;
while (ptr) {
-- if (!g_str_equal(ptr->data, "lo"))
-+ if (!g_str_equal(ptr->data, "lo0"))
- applet->devinfo = get_device_info(ptr->data);
- ptr = g_list_next(ptr);
- }
+- if (!g_str_equal(ptr->data, "lo")) {
++ if (!g_str_equal(ptr->data, "lo0")) {
+ get_device_info(ptr->data, &applet->devinfo);
+ break;
+ }
+@@ -1502,7 +1503,7 @@ netspeed_applet_factory(PanelApplet *app
free_devices_list(devices);
}
-- if (!applet->devinfo.name) applet->devinfo = get_device_info("lo");
-+ if (!applet->devinfo.name) applet->devinfo = get_device_info("lo0");
+ if (!applet->devinfo.name)
+- get_device_info("lo", &applet->devinfo);
++ get_device_info("lo0", &applet->devinfo);
applet->device_has_changed = TRUE;
applet->tooltips = gtk_tooltips_new();