make udhcp work under uclinux, to an extent
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index ab4fa30..babd980 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -102,6 +102,9 @@
void background(const char *pidfile)
{
+#ifdef __uClinux__
+ LOG(LOG_ERR, "Cannot background in uclinux (yet)");
+#else /* __uClinux__ */
int pid_fd = -1;
if (pidfile) {
@@ -131,6 +134,7 @@
lockf(pid_fd, F_UNLCK, 0);
close(pid_fd);
}
+#endif /* __uClinux__ */
}
/* Signal handler */
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c
index 7876dd3..0f2a21c 100644
--- a/networking/udhcp/script.c
+++ b/networking/udhcp/script.c
@@ -225,7 +225,7 @@
return;
/* call script */
- pid = fork();
+ pid = vfork();
if (pid) {
waitpid(pid, NULL, 0);
return;
@@ -235,7 +235,9 @@
/* close fd's? */
/* exec script */
+#ifndef __uClinux__
DEBUG(LOG_INFO, "execle'ing %s", client_config.script);
+#endif /* __uClinux__ */
execle(client_config.script, client_config.script,
name, NULL, envp);
LOG(LOG_ERR, "script %s failed: %m", client_config.script);