aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
commit5e2a5391f9142bca773aab4c829615895b69a6b7 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /debianutils
parente883e03918a0e26e390ea23996abdb8fc1925f88 (diff)
downloadbusybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.gz
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.bz2
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.) git-svn-id: svn://busybox.net/trunk/busybox@15767 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/start_stop_daemon.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 733fb4112..6f8fb2dc8 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -3,31 +3,22 @@
3 * Mini start-stop-daemon implementation(s) for busybox 3 * Mini start-stop-daemon implementation(s) for busybox
4 * 4 *
5 * Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>, 5 * Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>,
6 * public domain.
7 * Adapted for busybox David Kimdon <dwhedon@gordian.com> 6 * Adapted for busybox David Kimdon <dwhedon@gordian.com>
7 *
8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 9 */
9 10
10#include "busybox.h" 11#include "busybox.h"
11#include <stdio.h> 12#include <getopt.h>
12#include <stdlib.h>
13#include <string.h>
14#include <stdarg.h>
15#include <signal.h>
16#include <errno.h>
17#include <sys/stat.h>
18#include <dirent.h>
19#include <unistd.h>
20#include <getopt.h> /* struct option */
21#include "pwd_.h"
22 13
23static int signal_nr = 15; 14static int signal_nr = 15;
24static int user_id = -1; 15static int user_id = -1;
25static int quiet; 16static int quiet;
26static char *userspec = NULL; 17static char *userspec;
27static char *chuid = NULL; 18static char *chuid;
28static char *cmdname = NULL; 19static char *cmdname;
29static char *execname = NULL; 20static char *execname;
30static char *pidfile = NULL; 21static char *pidfile;
31 22
32struct pid_list { 23struct pid_list {
33 struct pid_list *next; 24 struct pid_list *next;
@@ -136,7 +127,7 @@ static void do_procinit(void)
136 return; 127 return;
137 } 128 }
138 129
139 procdir = bb_xopendir("/proc"); 130 procdir = xopendir("/proc");
140 131
141 foundany = 0; 132 foundany = 0;
142 while ((entry = readdir(procdir)) != NULL) { 133 while ((entry = readdir(procdir)) != NULL) {
@@ -292,12 +283,12 @@ int start_stop_daemon_main(int argc, char **argv)
292 } 283 }
293 *--argv = startas; 284 *--argv = startas;
294 if (opt & SSD_OPT_BACKGROUND) { 285 if (opt & SSD_OPT_BACKGROUND) {
295 bb_xdaemon(0, 0); 286 xdaemon(0, 0);
296 setsid(); 287 setsid();
297 } 288 }
298 if (opt & SSD_OPT_MAKEPID) { 289 if (opt & SSD_OPT_MAKEPID) {
299 /* user wants _us_ to make the pidfile */ 290 /* user wants _us_ to make the pidfile */
300 FILE *pidf = bb_xfopen(pidfile, "w"); 291 FILE *pidf = xfopen(pidfile, "w");
301 292
302 pid_t pidt = getpid(); 293 pid_t pidt = getpid();
303 fprintf(pidf, "%d\n", pidt); 294 fprintf(pidf, "%d\n", pidt);