summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2010-08-29 18:41:13 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2010-08-29 18:41:13 +0000
commitf30e021350fc8932d9baa9b5bc475517c42d2807 (patch)
tree73702f4989acda89ca2d0a26f95b6085f2d70a7a /sys/dev/acpi
parentf0e439af3db04c30c5696cbbf2293397b2a0530d (diff)
- add a check for FWRITE here too.
ok miod@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index ec0da75ec8c..43b482aff85 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.210 2010/08/27 20:31:55 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.211 2010/08/29 18:41:12 jasper Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2406,8 +2406,12 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
switch (cmd) {
case APM_IOC_SUSPEND:
case APM_IOC_STANDBY:
- sc->sc_sleepmode = ACPI_STATE_S3;
- acpi_wakeup(sc);
+ if ((flag & FWRITE) == 0) {
+ error = EBADF;
+ } else {
+ sc->sc_sleepmode = ACPI_STATE_S3;
+ acpi_wakeup(sc);
+ }
break;
case APM_IOC_GETPOWER:
/* A/C */