aboutsummaryrefslogtreecommitdiff
path: root/debianutils/start_stop_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'debianutils/start_stop_daemon.c')
-rw-r--r--debianutils/start_stop_daemon.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 576526183..a1c2c21c2 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -74,7 +74,7 @@ parse_options(int argc, char * const *argv)
74 break; 74 break;
75 case 's': 75 case 's':
76 if (sscanf(optarg, "%d", &signal_nr) != 1) 76 if (sscanf(optarg, "%d", &signal_nr) != 1)
77 error_msg_and_die ("-s takes a numeric argument"); 77 bb_error_msg_and_die ("-s takes a numeric argument");
78 break; 78 break;
79 case 'u': 79 case 'u':
80 userspec = optarg; 80 userspec = optarg;
@@ -86,21 +86,21 @@ parse_options(int argc, char * const *argv)
86 fork_before_exec = 1; 86 fork_before_exec = 1;
87 break; 87 break;
88 default: 88 default:
89 show_usage(); 89 bb_show_usage();
90 } 90 }
91 } 91 }
92 92
93 if (start == stop) 93 if (start == stop)
94 error_msg_and_die ("need one of -S or -K"); 94 bb_error_msg_and_die ("need one of -S or -K");
95 95
96 if (!execname && !userspec) 96 if (!execname && !userspec)
97 error_msg_and_die ("need at least one of -x or -u"); 97 bb_error_msg_and_die ("need at least one of -x or -u");
98 98
99 if (!startas) 99 if (!startas)
100 startas = execname; 100 startas = execname;
101 101
102 if (start && !startas) 102 if (start && !startas)
103 error_msg_and_die ("-S needs -x or -a"); 103 bb_error_msg_and_die ("-S needs -x or -a");
104} 104}
105 105
106 106
@@ -185,7 +185,7 @@ do_procfs(void)
185 185
186 procdir = opendir("/proc"); 186 procdir = opendir("/proc");
187 if (!procdir) 187 if (!procdir)
188 perror_msg_and_die ("opendir /proc"); 188 bb_perror_msg_and_die ("opendir /proc");
189 189
190 foundany = 0; 190 foundany = 0;
191 while ((entry = readdir(procdir)) != NULL) { 191 while ((entry = readdir(procdir)) != NULL) {
@@ -196,7 +196,7 @@ do_procfs(void)
196 } 196 }
197 closedir(procdir); 197 closedir(procdir);
198 if (!foundany) 198 if (!foundany)
199 error_msg_and_die ("nothing in /proc - not mounted?"); 199 bb_error_msg_and_die ("nothing in /proc - not mounted?");
200} 200}
201 201
202 202
@@ -214,7 +214,7 @@ do_stop(void)
214 else if (userspec) 214 else if (userspec)
215 sprintf(what, "process(es) owned by `%s'", userspec); 215 sprintf(what, "process(es) owned by `%s'", userspec);
216 else 216 else
217 error_msg_and_die ("internal error, please report"); 217 bb_error_msg_and_die ("internal error, please report");
218 218
219 if (!found) { 219 if (!found) {
220 printf("no %s found; none killed.\n", what); 220 printf("no %s found; none killed.\n", what);
@@ -225,7 +225,7 @@ do_stop(void)
225 p->pid = -p->pid; 225 p->pid = -p->pid;
226 killed++; 226 killed++;
227 } else { 227 } else {
228 perror_msg("warning: failed to kill %d:", p->pid); 228 bb_perror_msg("warning: failed to kill %d:", p->pid);
229 } 229 }
230 } 230 }
231 if (killed) { 231 if (killed) {
@@ -262,10 +262,10 @@ start_stop_daemon_main(int argc, char **argv)
262 *--argv = startas; 262 *--argv = startas;
263 if (fork_before_exec) { 263 if (fork_before_exec) {
264 if (daemon(0, 0) == -1) 264 if (daemon(0, 0) == -1)
265 perror_msg_and_die ("unable to fork"); 265 bb_perror_msg_and_die ("unable to fork");
266 } 266 }
267 setsid(); 267 setsid();
268 execv(startas, argv); 268 execv(startas, argv);
269 perror_msg_and_die ("unable to start %s", startas); 269 bb_perror_msg_and_die ("unable to start %s", startas);
270} 270}
271 271