aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruss <russ@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-12-15 22:11:26 +0000
committerruss <russ@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-12-15 22:11:26 +0000
commit9c8b7c46804c1bf9c50390b857f7bdf5ee69a4e0 (patch)
tree72865f8ca59214680c61d481f860115592f09a5c
parent0a6c8e13a39e597efd48872e5db6d2b74cce7bb8 (diff)
downloadbusybox-w32-9c8b7c46804c1bf9c50390b857f7bdf5ee69a4e0.tar.gz
busybox-w32-9c8b7c46804c1bf9c50390b857f7bdf5ee69a4e0.tar.bz2
busybox-w32-9c8b7c46804c1bf9c50390b857f7bdf5ee69a4e0.zip
make udhcp work under uclinux, to an extent
git-svn-id: svn://busybox.net/trunk/busybox@8089 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/udhcp/common.c4
-rw-r--r--networking/udhcp/script.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index ab4fa305a..babd980e3 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -102,6 +102,9 @@ static void exit_fun(void)
102 102
103void background(const char *pidfile) 103void background(const char *pidfile)
104{ 104{
105#ifdef __uClinux__
106 LOG(LOG_ERR, "Cannot background in uclinux (yet)");
107#else /* __uClinux__ */
105 int pid_fd = -1; 108 int pid_fd = -1;
106 109
107 if (pidfile) { 110 if (pidfile) {
@@ -131,6 +134,7 @@ void background(const char *pidfile)
131 lockf(pid_fd, F_UNLCK, 0); 134 lockf(pid_fd, F_UNLCK, 0);
132 close(pid_fd); 135 close(pid_fd);
133 } 136 }
137#endif /* __uClinux__ */
134} 138}
135 139
136/* Signal handler */ 140/* Signal handler */
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c
index 7876dd3c7..0f2a21c3a 100644
--- a/networking/udhcp/script.c
+++ b/networking/udhcp/script.c
@@ -225,7 +225,7 @@ void run_script(struct dhcpMessage *packet, const char *name)
225 return; 225 return;
226 226
227 /* call script */ 227 /* call script */
228 pid = fork(); 228 pid = vfork();
229 if (pid) { 229 if (pid) {
230 waitpid(pid, NULL, 0); 230 waitpid(pid, NULL, 0);
231 return; 231 return;
@@ -235,7 +235,9 @@ void run_script(struct dhcpMessage *packet, const char *name)
235 /* close fd's? */ 235 /* close fd's? */
236 236
237 /* exec script */ 237 /* exec script */
238#ifndef __uClinux__
238 DEBUG(LOG_INFO, "execle'ing %s", client_config.script); 239 DEBUG(LOG_INFO, "execle'ing %s", client_config.script);
240#endif /* __uClinux__ */
239 execle(client_config.script, client_config.script, 241 execle(client_config.script, client_config.script,
240 name, NULL, envp); 242 name, NULL, envp);
241 LOG(LOG_ERR, "script %s failed: %m", client_config.script); 243 LOG(LOG_ERR, "script %s failed: %m", client_config.script);