pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xbattbar rework the previous to not try to us...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0987aa0dccd9
branches:  trunk
changeset: 463423:0987aa0dccd9
user:      mrg <mrg%pkgsrc.org@localhost>
date:      Mon Nov 10 23:53:32 2003 +0000

description:
rework the previous to not try to use _PATH_SYSMON if it isn't defined.
fixes PR#23355 finally.

diffstat:

 sysutils/xbattbar/distinfo         |   4 ++--
 sysutils/xbattbar/patches/patch-ab |  23 ++++++++++++++---------
 2 files changed, 16 insertions(+), 11 deletions(-)

diffs (71 lines):

diff -r f933306f6183 -r 0987aa0dccd9 sysutils/xbattbar/distinfo
--- a/sysutils/xbattbar/distinfo        Mon Nov 10 23:15:21 2003 +0000
+++ b/sysutils/xbattbar/distinfo        Mon Nov 10 23:53:32 2003 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.8 2003/11/05 07:26:04 mrg Exp $
+$NetBSD: distinfo,v 1.9 2003/11/10 23:53:32 mrg Exp $
 
 SHA1 (xbattbar_1.4.2.tar.gz) = 14e9aafd62919e4a625d3f84df3b074b9eef8279
 Size (xbattbar_1.4.2.tar.gz) = 14079 bytes
 SHA1 (patch-aa) = 3bd4b688ccaeebe766335245c1a8c5dde52768c2
-SHA1 (patch-ab) = 4c2fd818e877606d8c5026c33a4475fa8b65bbf1
+SHA1 (patch-ab) = dfaf520dcc10228da4ab4c222210f0ecb4914f4f
diff -r f933306f6183 -r 0987aa0dccd9 sysutils/xbattbar/patches/patch-ab
--- a/sysutils/xbattbar/patches/patch-ab        Mon Nov 10 23:15:21 2003 +0000
+++ b/sysutils/xbattbar/patches/patch-ab        Mon Nov 10 23:53:32 2003 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ab,v 1.5 2003/11/05 07:26:04 mrg Exp $
+$NetBSD: patch-ab,v 1.6 2003/11/10 23:53:32 mrg Exp $
 
 --- xbattbar.c.orig    2001-02-02 16:25:29.000000000 +1100
-+++ xbattbar.c 2003-11-03 17:17:11.000000000 +1100
++++ xbattbar.c 2003-11-10 17:50:08.000000000 +1100
 @@ -27,6 +27,14 @@
  
  #include <sys/types.h>
@@ -17,7 +17,7 @@
  #include <signal.h>
  #include <stdio.h>
  #include <unistd.h>
-@@ -583,39 +590,171 @@
+@@ -583,39 +591,174 @@
  #define _PATH_APM_CTLDEV       "/dev/apmctl"
  #define _PATH_APM_NORMAL       "/dev/apm"
  
@@ -89,17 +89,22 @@
  {
         int fd, r, p;
         struct apm_power_info info;
+-
+-       if ((fd = open(_PATH_APM_NORMAL, O_RDONLY)) == -1) {
+-               fprintf(stderr, "xbattbar: cannot open apm device\n");
+-               exit(1);
 +       int acpi;
 +       size_t ns;
 +       size_t cc;
++       char *apmdev;
 +       int i;
- 
++
 +       acpi = 0;
-        if ((fd = open(_PATH_APM_NORMAL, O_RDONLY)) == -1) {
--               fprintf(stderr, "xbattbar: cannot open apm device\n");
--               exit(1);
++       apmdev = _PATH_APM_NORMAL;
++       if ((fd = open(apmdev, O_RDONLY)) == -1) {
 +#ifdef HAVE_NETBSD_ACPI
-+             fd = open(_PATH_SYSMON, O_RDONLY);
++             apmdev = _PATH_SYSMON;
++             fd = open(apmdev, O_RDONLY);
 +             acpi = 1;
 +#endif
         }
@@ -107,7 +112,7 @@
 -       if (ioctl(fd, APM_IOC_GETPOWER, &info) != 0) {
 -               fprintf(stderr, "xbattbar: ioctl APM_IOC_GETPOWER failed\n");
 +       if (fd < 0) {
-+               fprintf(stderr, "xbattbar: cannot open %s device\n", (acpi) ? _PATH_SYSMON : _PATH_APM_NORMAL);
++               fprintf(stderr, "xbattbar: cannot open %s device\n", apmdev);
                 exit(1);
         }
  



Home | Main Index | Thread Index | Old Index