summaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index ebd32f8..81ae126 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -15,13 +15,9 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
#include <paths.h>
#include "libbb.h"
-
#ifdef BB_NOMMU
void vfork_daemon_rexec(int nochdir, int noclose,
int argc, char **argv, char *foreground_opt)
@@ -43,9 +39,9 @@ void vfork_daemon_rexec(int nochdir, int noclose,
close(fd);
}
- vfork_args = xcalloc(sizeof(char *), argc + 3);
+ vfork_args = xzalloc(sizeof(char *) * (argc + 3));
vfork_args[a++] = CONFIG_BUSYBOX_EXEC_PATH;
- while(*argv) {
+ while (*argv) {
vfork_args[a++] = *argv;
argv++;
}