FreeBSD Bugzilla – Attachment 17814 Details for
Bug 32251
bugfix and new feature for apmd
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.51 KB, created by
Walter C. Pelissero
on 2001-11-24 13:50:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Walter C. Pelissero
Created:
2001-11-24 13:50:01 UTC
Size:
1.51 KB
patch
obsolete
>--- /usr/home/wcp/tmp/apmd/apmd.c Fri Oct 12 20:22:34 2001 >+++ /usr/src/usr.sbin/apmd/apmd.c Sat Oct 13 14:58:35 2001 >@@ -55,7 +55,7 @@ > extern int yyparse(void); > > int debug_level = 0; >-int verbose = 0; >+int verbose = 0, soft_power_state_change = 0; > const char *apmd_configfile = APMD_CONFIGFILE; > const char *apmd_pidfile = APMD_PIDFILE; > int apmctl_fd = -1, apmnorm_fd = -1; >@@ -464,7 +464,6 @@ > int > proc_signal(int fd) > { >- int rc = -1; > int sig; > > while (read(fd, &sig, sizeof sig) == sizeof sig) { >@@ -476,8 +475,7 @@ > break; > case SIGTERM: > syslog(LOG_NOTICE, "going down on signal %d", sig); >- rc = 1; >- goto out; >+ return -1; > case SIGCHLD: > wait_child(); > break; >@@ -486,9 +484,7 @@ > break; > } > } >- rc = 0; >- out: >- return rc; >+ return 0; > } > void > proc_apmevent(int fd) >@@ -548,6 +544,8 @@ > * the event-caught state. > */ > if (last_state != AC_POWER_STATE) { >+ if (soft_power_state_change && fork() == 0) >+ exit(exec_event_cmd(&events[PMEV_POWERSTATECHANGE])); > last_state = AC_POWER_STATE; > for (p = battery_watch_list ; p!=NULL ; p = p -> next) > p->done = 0; >@@ -642,7 +640,7 @@ > char *prog; > int logopt = LOG_NDELAY | LOG_PID; > >- while ((ch = getopt(ac, av, "df:v")) != EOF) { >+ while ((ch = getopt(ac, av, "df:vs")) != EOF) { > switch (ch) { > case 'd': > daemonize = 0; >@@ -653,6 +651,9 @@ > break; > case 'v': > verbose = 1; >+ break; >+ case 's': >+ soft_power_state_change = 1; > break; > default: > (void) err(1, "unknown option `%c'", ch);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32251
: 17814