aboutsummaryrefslogtreecommitdiff
path: root/util-linux/acpid.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/acpid.c')
-rw-r--r--util-linux/acpid.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index 38421c2d7..0f2cb6bdc 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -121,10 +121,8 @@ static void process_event(const char *event)
121 char *handler = xasprintf("./%s", event); 121 char *handler = xasprintf("./%s", event);
122 const char *args[] = { "run-parts", handler, NULL }; 122 const char *args[] = { "run-parts", handler, NULL };
123 123
124 // debug info 124 // log the event
125 if (option_mask32 & OPT_d) { 125 bb_error_msg("%s", event);
126 bb_error_msg("%s", event);
127 }
128 126
129 // spawn handler 127 // spawn handler
130 // N.B. run-parts would require scripts to have #!/bin/sh 128 // N.B. run-parts would require scripts to have #!/bin/sh
@@ -153,7 +151,7 @@ static const char *find_action(struct input_event *ev, const char *buf)
153 } 151 }
154 152
155 if (buf) { 153 if (buf) {
156 if (strncmp(buf, evt_tab[i].desc, strlen(buf)) == 0) { 154 if (is_prefixed_with(evt_tab[i].desc, buf)) {
157 action = evt_tab[i].desc; 155 action = evt_tab[i].desc;
158 break; 156 break;
159 } 157 }
@@ -256,7 +254,7 @@ int acpid_main(int argc UNUSED_PARAM, char **argv)
256 /* No -d "Debug", we log to log file. 254 /* No -d "Debug", we log to log file.
257 * This includes any output from children. 255 * This includes any output from children.
258 */ 256 */
259 xmove_fd(xopen(opt_logfile, O_WRONLY | O_CREAT | O_TRUNC), STDOUT_FILENO); 257 xmove_fd(xopen(opt_logfile, O_WRONLY | O_CREAT | O_APPEND), STDOUT_FILENO);
260 xdup2(STDOUT_FILENO, STDERR_FILENO); 258 xdup2(STDOUT_FILENO, STDERR_FILENO);
261 /* Also, acpid's messages (but not children) will go to syslog too */ 259 /* Also, acpid's messages (but not children) will go to syslog too */
262 openlog(applet_name, LOG_PID, LOG_DAEMON); 260 openlog(applet_name, LOG_PID, LOG_DAEMON);