diff options
Diffstat (limited to 'x11-wm/icewm/files/patch-ak')
-rw-r--r-- | x11-wm/icewm/files/patch-ak | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/x11-wm/icewm/files/patch-ak b/x11-wm/icewm/files/patch-ak deleted file mode 100644 index c06a68797b72..000000000000 --- a/x11-wm/icewm/files/patch-ak +++ /dev/null @@ -1,75 +0,0 @@ ---- src/aapm.cc.orig Sun Aug 24 23:59:24 2003 -+++ src/aapm.cc Wed Sep 17 03:11:49 2003 -@@ -26,6 +26,13 @@ - #include <string.h> - #include <stdio.h> - -+#ifdef __FreeBSD__ -+#include <sys/file.h> -+#include <sys/ioctl.h> -+#include <sys/types.h> -+#include <machine/apm_bios.h> -+#endif -+ - YColor *YApm::apmBg = 0; - YColor *YApm::apmFg = 0; - YFont *YApm::apmFont = 0; -@@ -47,8 +54,12 @@ - - - void ApmStr(char *s, bool Tool) { -+#ifdef __FreeBSD__ -+ struct apm_info ai; -+#else - char buf[80]; -- int len, i, fd = open("/proc/apm", O_RDONLY); -+#endif -+ int len, i, fd = open(APMDEV, O_RDONLY); - char driver[16]; - char apmver[16]; - int apmflags; -@@ -60,9 +71,31 @@ - char units[16]; - - if (fd == -1) { -+ static int error = 0; -+ if (!error) -+ perror("Can't open the apm device"); -+ error = 1; - return ; - } -+#ifdef __FreeBSD__ -+ if (ioctl(fd,APMIO_GETINFO, &ai) == -1) -+ { -+ static int error = 0; -+ if (!error) -+ perror("Can't ioctl the apm device"); -+ error = 1; -+ close(fd); -+ return; -+ } -+ close(fd); - -+ sprintf(apmver, "%u.%u", ai.ai_major, ai.ai_minor); -+ ACstatus = ai.ai_acline; -+ BATflag = ai.ai_batt_stat == 3 ? 8 : 0; -+ BATlife = ai.ai_batt_life; -+ BATtime = ai.ai_batt_time == 0 ? -1 : ai.ai_batt_time; -+ strcpy(units, "sec"); -+#else - len = read(fd, buf, sizeof(buf) - 1); - close(fd); - -@@ -76,10 +109,11 @@ - static int error = 1; - if (error) { - error = 0; -- warn(_("/proc/apm - unknown format (%d)"), i); -+ warn(_("%s - unknown format (%d)"), APMDEV, i); - } - return ; - } -+#endif - if (BATlife == -1) - BATlife = 0; - |