Hi again Alan,
Stephen Rothwell <[EMAIL PROTECTED]> writes:
> Hi Alan,
>
> I know that this is a large patch, but some of it has been
> waiting around since last October and there is stuff in here
> that people want (in particular there is a patch requested
> by the XFree86 guys so that the X server can be made APM
> aware).
I have updated this patch ... ioctl's now return :-)
The patch can be found at
http://linuxcare.com.au/apm/2.2.14-APM.4.gz
or
http://linuxcare.com.au/apm/2.2.15pre6-APM.2.gz
If this patch is too big, I MAY be persuaded to do it in bits
(but I would much prefer not to ...).
The difference between this and the previous patch is this:
diff -ruN 2.2.14-APM.3/Documentation/Configure.help
2.2.14-APM/Documentation/Configure.help
--- 2.2.14-APM.3/Documentation/Configure.help Tue Feb 8 17:09:35 2000
+++ 2.2.14-APM/Documentation/Configure.help Tue Feb 8 13:28:18 2000
@@ -9026,7 +9026,7 @@
Supporting software is available; for more information, read the
Battery Powered Linux mini-HOWTO, available from
- http://metalab.unc.edu/mdw/linux.html#howto .
+ http://www.linuxdoc.org/docs.html#howto .
This driver does not spin down disk drives (see the hdparm(8)
manpage ("man 8 hdparm") for that), and it doesn't turn off
diff -ruN 2.2.14-APM.3/arch/i386/kernel/apm.c 2.2.14-APM/arch/i386/kernel/apm.c
--- 2.2.14-APM.3/arch/i386/kernel/apm.c Tue Feb 8 17:09:35 2000
+++ 2.2.14-APM/arch/i386/kernel/apm.c Tue Feb 8 17:06:10 2000
@@ -877,21 +877,19 @@
static int suspend(void)
{
int err;
+ int ret;
struct apm_user *as;
get_time_diff();
err = apm_set_power_state(APM_STATE_SUSPEND);
reinit_timer();
set_time();
- if ((err == APM_SUCCESS) || (err == APM_NO_ERROR)) {
- err = 1;
- } else {
+ ret = (err == APM_SUCCESS) || (err == APM_NO_ERROR);
+ if (!ret)
apm_error("suspend", err);
- err = 0;
- for (as = user_list; as != NULL; as = as->next) {
- as->suspend_wait = 0;
- as->suspend_result = -EIO;
- }
+ for (as = user_list; as != NULL; as = as->next) {
+ as->suspend_wait = 0;
+ as->suspend_result = (ret ? 0 : -EIO);
}
wake_up_interruptible(&apm_suspend_waitqueue);
return err;
@@ -1168,7 +1166,6 @@
if (!suspend())
return -EIO;
} else {
- as->suspend_result = 0;
as->suspend_wait = 1;
add_wait_queue(&apm_suspend_waitqueue, &wait);
while (1) {
@@ -1180,8 +1177,7 @@
}
current->state = TASK_RUNNING;
remove_wait_queue(&apm_suspend_waitqueue, &wait);
- if (as->suspend_result)
- return as->suspend_result;
+ return as->suspend_result;
}
break;
default:
Cheers,
Stephen
--
Stephen Rothwell, Open Source Project Engineer, Linuxcare, Inc.
+61-2-62628990 tel, +61-2-62628991 fax
[EMAIL PROTECTED], http://www.linuxcare.com/
Linuxcare. Support for the revolution.