diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/vfork_daemon_rexec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index c59b0b6fd..89ae9a73c 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c | |||
@@ -115,7 +115,7 @@ void vfork_daemon_rexec(int nochdir, int noclose, char **argv) | |||
115 | #endif /* BB_NOMMU */ | 115 | #endif /* BB_NOMMU */ |
116 | 116 | ||
117 | #ifdef BB_NOMMU | 117 | #ifdef BB_NOMMU |
118 | static void daemon_or_rexec(char **argv) | 118 | void forkexit_or_rexec(char **argv) |
119 | { | 119 | { |
120 | pid_t pid; | 120 | pid_t pid; |
121 | /* Maybe we are already re-execed and come here again? */ | 121 | /* Maybe we are already re-execed and come here again? */ |
@@ -135,7 +135,9 @@ static void daemon_or_rexec(char **argv) | |||
135 | bb_perror_msg_and_die("exec %s", CONFIG_BUSYBOX_EXEC_PATH); | 135 | bb_perror_msg_and_die("exec %s", CONFIG_BUSYBOX_EXEC_PATH); |
136 | } | 136 | } |
137 | #else | 137 | #else |
138 | static void daemon_or_rexec(void) | 138 | /* Dance around (void)...*/ |
139 | #undef forkexit_or_rexec | ||
140 | void forkexit_or_rexec(void) | ||
139 | { | 141 | { |
140 | pid_t pid; | 142 | pid_t pid; |
141 | pid = fork(); | 143 | pid = fork(); |
@@ -145,7 +147,7 @@ static void daemon_or_rexec(void) | |||
145 | exit(0); | 147 | exit(0); |
146 | /* child */ | 148 | /* child */ |
147 | } | 149 | } |
148 | #define daemon_or_rexec(argv) daemon_or_rexec() | 150 | #define forkexit_or_rexec(argv) forkexit_or_rexec() |
149 | #endif | 151 | #endif |
150 | 152 | ||
151 | 153 | ||
@@ -170,7 +172,7 @@ void bb_daemonize_or_rexec(int flags, char **argv) | |||
170 | fd = dup(fd); /* have 0,1,2 open at least to /dev/null */ | 172 | fd = dup(fd); /* have 0,1,2 open at least to /dev/null */ |
171 | 173 | ||
172 | if (!(flags & DAEMON_ONLY_SANITIZE)) { | 174 | if (!(flags & DAEMON_ONLY_SANITIZE)) { |
173 | daemon_or_rexec(argv); | 175 | forkexit_or_rexec(argv); |
174 | /* if daemonizing, make sure we detach from stdio */ | 176 | /* if daemonizing, make sure we detach from stdio */ |
175 | setsid(); | 177 | setsid(); |
176 | dup2(fd, 0); | 178 | dup2(fd, 0); |