diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-03-22 05:24:04 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-03-22 05:24:04 +0000 |
commit | 0bc5993a89be95ce9ca6c671804ce9e8eb5f2e7b (patch) | |
tree | 8d7a2fc36e804c2314419a87ba08becdf3663c55 /usr.sbin | |
parent | 7c67d3134ec53a23ac833b10e0de842f21764474 (diff) |
Power status change after resume only if it really changed.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/apmd/apmd.8 | 5 | ||||
-rw-r--r-- | usr.sbin/apmd/apmd.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/apmd/apmd.8 b/usr.sbin/apmd/apmd.8 index 49ea563534b..b073f2a5605 100644 --- a/usr.sbin/apmd/apmd.8 +++ b/usr.sbin/apmd/apmd.8 @@ -24,7 +24,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: apmd.8,v 1.13 2001/03/22 04:51:13 angelos Exp $ +.\" $Id: apmd.8,v 1.14 2001/03/22 05:24:03 angelos Exp $ .\" .Dd March 24, 1996 .Dt APMD 8 @@ -166,7 +166,8 @@ mode. The resume program is run after resuming from a stand-by or suspended state. The powerup and powerdown programs are run after the power status (AC -connected or not) changes, as well as after a resume. +connected or not) changes, as well as after a resume (if the power +status changed in the mean time). .Sh FILES .Pa /etc/apm/suspend , .Pa /etc/apm/standby , diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index ebff27fea58..ab38ebe7e62 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -448,8 +448,11 @@ main(int argc, char *argv[]) case APM_NORMAL_RESUME: case APM_CRIT_RESUME: case APM_SYS_STANDBY_RESUME: - powerstatus = power_status(ctl_fd, 0, 0); - powerchange = 1; + powerbak = power_status(ctl_fd, 0, 0); + if (powerstatus != powerbak) { + powerstatus = powerbak; + powerchange = 1; + } resumes++; break; case APM_POWER_CHANGE: |