aboutsummaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-03-26 13:35:09 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-03-26 13:35:09 +0000
commit53091ecd20c294f0e0757a5f4e0d5c8c7b23b555 (patch)
treef4ae0be26d5debff091d2c976e77fa8050c6758c /libbb/vfork_daemon_rexec.c
parentec1a4b5a521b5adf295bc757c25231910f8c854b (diff)
downloadbusybox-w32-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.tar.gz
busybox-w32-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.tar.bz2
busybox-w32-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.zip
Attempt to get more applets compile for NOMMU.
TODO_config_nommu documents what I managed to compile so far (yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO Also make fork(), daemon() produce warnings on compile stage (in addition to erros on link stage).
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c10
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
118static void daemon_or_rexec(char **argv) 118void 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
138static void daemon_or_rexec(void) 138/* Dance around (void)...*/
139#undef forkexit_or_rexec
140void 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);