hal/hald util.c,1.14,1.15
David Zeuthen
david at freedesktop.org
Sun May 8 20:43:28 PDT 2005
Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv17086/hald
Modified Files:
util.c
Log Message:
2005-05-08 David Zeuthen <davidz at redhat.com>
* hald/linux2/addons/addon-pmu.c: New file (polls /dev/apm for
lid button events)
* hald/linux2/addons/Makefile.am (libexec_PROGRAMS): Also build
hald-addon-pmu
* hald/linux2/pmu.c (battery_refresh): Support battery.current
(lid_button_refresh): New function
(pmu_lid_compute_udi): New function
(pmu_poll): New function
(pmu_synthesize_hotplug_events): Add lid object and setup a timeout
for polling
* fdi/policy/10osvendor/10-power-mgmt-policy.fdi: Run the pmu addon
to detect lid button events.
Index: util.c
===================================================================
RCS file: /cvs/hal/hal/hald/util.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- util.c 8 Apr 2005 18:10:20 -0000 1.14
+++ util.c 9 May 2005 03:43:26 -0000 1.15
@@ -32,7 +32,7 @@
#include <string.h>
#include <mntent.h>
#include <errno.h>
-
+#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -793,7 +793,8 @@
value = G_MAXINT;
- if ((strvalue = hal_util_grep_string_elem_from_file (directory, file, linestart, elem, reuse)) == NULL)
+ strvalue = hal_util_grep_string_elem_from_file (directory, file, linestart, elem, reuse);
+ if (strvalue == NULL)
goto out;
value = strtol (strvalue, &endptr, base);
@@ -880,7 +881,8 @@
res = FALSE;
- if ((strvalue = hal_util_grep_string_elem_from_file (directory, file, linestart, elem, reuse)) == NULL)
+ strvalue = hal_util_grep_string_elem_from_file (directory, file, linestart, elem, reuse);
+ if (strvalue == NULL)
goto out;
value = strtol (strvalue, &endptr, base);
More information about the hal-commit
mailing list