aboutsummaryrefslogtreecommitdiffstats
path: root/x11-wm/icewm/files
diff options
context:
space:
mode:
authornakai <nakai@FreeBSD.org>2001-04-16 15:06:31 +0800
committernakai <nakai@FreeBSD.org>2001-04-16 15:06:31 +0800
commit55f64f4bfabfd397f2eb67b62e1cec4450a0dccd (patch)
tree315d5da43d97355095de8661642611b7ee8787e7 /x11-wm/icewm/files
parent04f5399d4b10e7bac3978d9ff56c9c7e6d61e856 (diff)
downloadfreebsd-ports-gnome-55f64f4bfabfd397f2eb67b62e1cec4450a0dccd.tar.gz
freebsd-ports-gnome-55f64f4bfabfd397f2eb67b62e1cec4450a0dccd.tar.zst
freebsd-ports-gnome-55f64f4bfabfd397f2eb67b62e1cec4450a0dccd.zip
Add appstatus port patch
Submitted by: Aleksey Malyshev <alex@smallet.spb.ru>
Diffstat (limited to 'x11-wm/icewm/files')
-rw-r--r--x11-wm/icewm/files/patch-am49
1 files changed, 49 insertions, 0 deletions
diff --git a/x11-wm/icewm/files/patch-am b/x11-wm/icewm/files/patch-am
new file mode 100644
index 000000000000..da482f7634b8
--- /dev/null
+++ b/x11-wm/icewm/files/patch-am
@@ -0,0 +1,49 @@
+--- src/apppstatus.cc.orig Sat Mar 17 00:17:37 2001
++++ src/apppstatus.cc Thu Apr 5 22:45:29 2001
+@@ -270,6 +270,7 @@
+ return isUpIsdn();
+ #endif
+
++#ifndef __FreeBSD__
+ char buffer[32 * sizeof(struct ifreq)];
+ struct ifconf ifc;
+ struct ifreq *ifr;
+@@ -301,6 +302,38 @@
+ }
+
+ close(s);
++
++#else // __FreeBSD__
++ // FreeBSD code by Ronald Klop <ronald@cs.vu.nl>
++ struct ifmibdata ifmd;
++ size_t ifmd_size=sizeof(ifmibdata);
++ int nr_network_devs;
++ size_t int_size=sizeof(int);
++ int name[6];
++ name[0] = CTL_NET;
++ name[1] = PF_LINK;
++ name[2] = NETLINK_GENERIC;
++ name[3] = IFMIB_IFDATA;
++ name[5] = IFDATA_GENERAL;
++
++ if(sysctlbyname("net.link.generic.system.ifcount",&nr_network_devs,
++ &int_size,(void*)0,0) == -1) {
++ printf("%s@%d: %s\n",__FILE__,__LINE__,strerror(errno));
++ } else {
++ for(int i=1;i<=nr_network_devs;i++) {
++ name[4] = i; /* row of the ifmib table */
++
++ if(sysctl(name, 6, &ifmd, &ifmd_size, (void *)0, 0) == -1) {
++ printf(_("%s@%d: %s\n"),__FILE__,__LINE__,strerror(errno));
++ continue;
++ }
++
++ if (strcmp(ifmd.ifmd_name, netDevice) == 0 && (ifmd.ifmd_flags & IFF_RUNNING)) {
++ return true;
++ }
++ }
++ }
++#endif // __FreeBSD__
+ return false;
+ #endif // if 0
+ }