summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-23 14:56:15 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-23 14:56:15 +0000
commitc4a3f3f81ea90e3df93c352ac0e2161a4bfd3327 (patch)
treea51090af30c4c901647c5d2bb1c791f9b06d0cdf
parent4d7c5fea1ce2cca0275f58a86138bc402a7f09fe (diff)
downloaduClibc-alpine-c4a3f3f81ea90e3df93c352ac0e2161a4bfd3327.tar.bz2
uClibc-alpine-c4a3f3f81ea90e3df93c352ac0e2161a4bfd3327.tar.xz
Only compile in daemon() if the target has an MMU.
-Erik
-rw-r--r--libc/unistd/Makefile5
-rw-r--r--libc/unistd/daemon.c7
2 files changed, 6 insertions, 6 deletions
diff --git a/libc/unistd/Makefile b/libc/unistd/Makefile
index f9692ab6c..7b51f075c 100644
--- a/libc/unistd/Makefile
+++ b/libc/unistd/Makefile
@@ -26,7 +26,10 @@ LIBC=$(TOPDIR)libc.a
DIRS:=
CSRC=execl.c execlp.c execv.c execvep.c execvp.c execle.c getcwd.c getopt.c \
- sleep.c getpass.c sysconf_src.c getopt_vars.c daemon.c getlogin.c fpathconf.c
+ sleep.c getpass.c sysconf_src.c getopt_vars.c getlogin.c fpathconf.c
+ifeq ($(strip $(HAS_MMU)),true)
+ CSRC+=daemon.c
+endif
# TESTING -- comment this out if it breaks for you
ifeq ($(TARGET_ARCH), $(NATIVE_ARCH))
diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c
index 10473cf74..d10c7931c 100644
--- a/libc/unistd/daemon.c
+++ b/libc/unistd/daemon.c
@@ -32,10 +32,11 @@
#include <paths.h>
#include <unistd.h>
+/* Note that this file should not be compiled in
+ * unless __UCLIBC_HAS_MMU__ is defined */
int daemon( int nochdir, int noclose )
{
-#if __UCLIBC_HAS_MMU__
int fd;
switch (fork()) {
@@ -61,10 +62,6 @@ int daemon( int nochdir, int noclose )
close(fd);
}
return(0);
-#else
- fprintf(stderr, "Sorry, daemon() requires an MMU\n");
- return(-1);
-#endif
}