summaryrefslogtreecommitdiff
path: root/ham/dpbox/patches/patch-ah
diff options
context:
space:
mode:
Diffstat (limited to 'ham/dpbox/patches/patch-ah')
-rw-r--r--ham/dpbox/patches/patch-ah75
1 files changed, 75 insertions, 0 deletions
diff --git a/ham/dpbox/patches/patch-ah b/ham/dpbox/patches/patch-ah
new file mode 100644
index 00000000000..da900c9f72d
--- /dev/null
+++ b/ham/dpbox/patches/patch-ah
@@ -0,0 +1,75 @@
+$NetBSD: patch-ah,v 1.1 2006/01/24 22:27:07 joerg Exp $
+
+--- status.c.orig 2000-04-27 12:48:55.000000000 +0000
++++ status.c
+@@ -27,7 +27,7 @@
+ #include <utsname.h>
+ #endif
+
+-#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__DragonFly__)
+ #include <sys/utsname.h>
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+@@ -110,7 +110,7 @@ long get_sysruntime(void)
+ static time_t lastsysrunt = 0;
+ static time_t lastsysrunres = 0;
+
+-#ifndef __NetBSD__
++#if !defined(__NetBSD__) && !defined(__DragonFly__)
+ short k;
+ char hs[256], w[256];
+ short x, y;
+@@ -145,7 +145,7 @@ void get_sysload(char *s)
+ static time_t lastsysltime = 0;
+ static char lastsysload[21] = "";
+
+-#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__DragonFly__)
+ double loadavg[3];
+ #else
+ short k;
+@@ -185,7 +185,7 @@ void get_sysload(char *s)
+
+ } else
+ #endif
+-#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__DragonFly__)
+ if (getloadavg(loadavg, 3))
+ sprintf(s,"load averages: %.2f%%, %.2f%%, %.2f%%\n",
+ loadavg[0], loadavg[1], loadavg[2]);
+@@ -205,7 +205,7 @@ void get_cpuinf(char *cpu, char *bmips)
+
+ short k;
+ char *hp;
+-#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__DragonFly__)
+ int mib[2];
+ size_t len;
+ #else
+@@ -250,7 +250,15 @@ void get_cpuinf(char *cpu, char *bmips)
+ strcpy(lastcputype, &hs[1]);
+ }
+ #endif
+-#ifdef __NetBSD__
++#ifdef __DragonFly__
++ sysctlbyname("hw.model", NULL, &len, NULL, 0);
++ if ((hp = malloc(len)) != NULL) {
++ sysctlbyname("hw.model", hp, &len, NULL, 0);
++ snprintf(lastcputype,80,"%s",hp);
++ free(hp);
++ }
++#endif
++#if defined(__NetBSD__)
+ mib[0] = CTL_HW;
+ mib[1] = HW_MODEL;
+ sysctl(mib, 2, NULL, &len, NULL, 0);
+@@ -303,7 +311,7 @@ void get_linpack(char *s)
+
+ void get_sysversion(char *s)
+ {
+-#if defined(__macos__) || defined(__NetBSD__)
++#if defined(__macos__) || defined(__NetBSD__) || defined(__DragonFly__)
+ struct utsname name;
+
+ strcpy(s, "?");