Magellan Linux

Contents of /trunk/hal/patches/hal-0.5.7.1-pmu-fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations) (download)
Fri Oct 20 18:01:50 2006 UTC (17 years, 6 months ago) by niro
File size: 982 byte(s)
patches and files for hal-0.5.7.1-r1

1 diff -ruN hal-0.5.7-old/hald/linux2/osspec.c hal-0.5.7/hald/linux2/osspec.c
2 --- hal-0.5.7-old/hald/linux2/osspec.c 2006-02-13 17:42:32.000000000 +0100
3 +++ hal-0.5.7/hald/linux2/osspec.c 2006-03-01 11:56:20.000000000 +0100
4 @@ -447,6 +447,7 @@
5 unsigned int len;
6 char *poweroptions;
7 FILE *fp;
8 + const char* pmtype = NULL;
9
10 can_suspend = FALSE;
11 can_hibernate = FALSE;
12 @@ -471,6 +472,16 @@
13 can_hibernate = TRUE;
14 free (poweroptions);
15
16 + pmtype = hal_device_property_get_string(d,"power_management.type");
17 + if (pmtype && !strcmp(pmtype, "pmu")) {
18 + /* Although /sys/power/state exists on pmu based machines, using it just
19 + * crashes mine. Suspending works via the pmu though. So overriding what we
20 + * just saw...
21 + * Should be removed as soon as /sys/power works on PMU */
22 + can_hibernate = FALSE;
23 + can_suspend = TRUE;
24 + }
25 +
26 /* check for the presence of suspend2 */
27 if (access ("/proc/software_suspend", F_OK) == 0)
28 can_hibernate = TRUE;