diff options
author | Rob Landley | 2006-08-03 15:41:12 +0000 |
---|---|---|
committer | Rob Landley | 2006-08-03 15:41:12 +0000 |
commit | d921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch) | |
tree | e4a2769349867c441cf2983d83097bb66701a733 /debianutils/start_stop_daemon.c | |
parent | 6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff) | |
download | busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz |
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.)
Diffstat (limited to 'debianutils/start_stop_daemon.c')
-rw-r--r-- | debianutils/start_stop_daemon.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index 733fb41..6f8fb2d 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c @@ -3,31 +3,22 @@ * Mini start-stop-daemon implementation(s) for busybox * * Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>, - * public domain. * Adapted for busybox David Kimdon <dwhedon@gordian.com> + * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include "busybox.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <stdarg.h> -#include <signal.h> -#include <errno.h> -#include <sys/stat.h> -#include <dirent.h> -#include <unistd.h> -#include <getopt.h> /* struct option */ -#include "pwd_.h" +#include <getopt.h> static int signal_nr = 15; static int user_id = -1; static int quiet; -static char *userspec = NULL; -static char *chuid = NULL; -static char *cmdname = NULL; -static char *execname = NULL; -static char *pidfile = NULL; +static char *userspec; +static char *chuid; +static char *cmdname; +static char *execname; +static char *pidfile; struct pid_list { struct pid_list *next; @@ -136,7 +127,7 @@ static void do_procinit(void) return; } - procdir = bb_xopendir("/proc"); + procdir = xopendir("/proc"); foundany = 0; while ((entry = readdir(procdir)) != NULL) { @@ -292,12 +283,12 @@ int start_stop_daemon_main(int argc, char **argv) } *--argv = startas; if (opt & SSD_OPT_BACKGROUND) { - bb_xdaemon(0, 0); + xdaemon(0, 0); setsid(); } if (opt & SSD_OPT_MAKEPID) { /* user wants _us_ to make the pidfile */ - FILE *pidf = bb_xfopen(pidfile, "w"); + FILE *pidf = xfopen(pidfile, "w"); pid_t pidt = getpid(); fprintf(pidf, "%d\n", pidt); |