aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);