diff options
author | Nikolay Sturm <sturm@cvs.openbsd.org> | 2006-03-15 20:30:29 +0000 |
---|---|---|
committer | Nikolay Sturm <sturm@cvs.openbsd.org> | 2006-03-15 20:30:29 +0000 |
commit | 5d566994237591142b6ec4faf4cc9550660081e2 (patch) | |
tree | dc251d380884474509d8af78e402a221df98d1f6 /usr.sbin/apmd/apmd.c | |
parent | 114010020db8185a708ae738108cf94e5781f763 (diff) |
consistently use power *states* and performance *modes*
ok beck, mickey
Diffstat (limited to 'usr.sbin/apmd/apmd.c')
-rw-r--r-- | usr.sbin/apmd/apmd.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index 4d8f5b79ec0..d36191cc382 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apmd.c,v 1.42 2006/03/14 22:30:53 sturm Exp $ */ +/* $OpenBSD: apmd.c,v 1.43 2006/03/15 20:30:28 sturm Exp $ */ /* * Copyright (c) 1995, 1996 John T. Kohl @@ -338,13 +338,13 @@ handle_client(int sock_fd, int ctl_fd) reply.newstate = STANDING_BY; break; case SETPERF_LOW: - doperf = PERF_LOW; + doperf = PERF_MANUAL; reply.newstate = NORMAL; syslog(LOG_NOTICE, "setting hw.setperf to %d", PERFMIN); setperf(PERFMIN); break; case SETPERF_HIGH: - doperf = PERF_HIGH; + doperf = PERF_MANUAL; reply.newstate = NORMAL; syslog(LOG_NOTICE, "setting hw.setperf to %d", PERFMAX); setperf(PERFMAX); @@ -368,7 +368,7 @@ handle_client(int sock_fd, int ctl_fd) syslog(LOG_INFO, "cannot read hw.cpuspeed"); reply.cpuspeed = cpuspeed; - reply.perfstate = doperf; + reply.perfmode = doperf; reply.vno = APMD_VNO; if (send(cli_fd, &reply, sizeof(reply), 0) != sizeof(reply)) syslog(LOG_INFO, "client reply botch"); @@ -460,13 +460,13 @@ main(int argc, char *argv[]) case 'L': if (doperf != PERF_NONE) usage(); - doperf = PERF_LOW; + doperf = PERF_MANUAL; setperf(PERFMIN); break; case 'H': if (doperf != PERF_NONE) usage(); - doperf = PERF_HIGH; + doperf = PERF_MANUAL; setperf(PERFMAX); break; case 'm': @@ -480,6 +480,9 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (doperf == PERF_NONE) + doperf = PERF_MANUAL; + if (debug) openlog(__progname, LOG_CONS, LOG_LOCAL1); else { |