summaryrefslogtreecommitdiff
path: root/libc/unistd
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-10-31 18:20:21 +0000
committerEric Andersen <andersen@codepoet.org>2002-10-31 18:20:21 +0000
commit6737908f74ff566748864548cf35bb1da8e64af6 (patch)
tree6eeafda4548f49d960e1b597c880a810a08a66f0 /libc/unistd
parentc734e7ca57f520e55236b21eaef16ac40099a378 (diff)
Ok, this commit is _huge_ and its gonna change the world. I've
been working on a new config system on and off for about 6 months now, but I've never been fully satisfied. Well, I'm finally am happy with the new config system, so here it is. This completely removes the old uClibc configuration system, and replaces it with an entirely new system based on LinuxKernelConf, from http://www.xs4all.nl/~zippel/lc/ As it turns out, Linus has just merged LinuxKernelConf into Linux 2.5.45, so it looks like I made the right choice. I have thus far updated only x86. I'll be updating the other architectures shortly. -Erik
Diffstat (limited to 'libc/unistd')
-rw-r--r--libc/unistd/Makefile2
-rw-r--r--libc/unistd/daemon.c5
-rw-r--r--libc/unistd/fpathconf.c2
-rw-r--r--libc/unistd/pathconf.c2
4 files changed, 8 insertions, 3 deletions
diff --git a/libc/unistd/Makefile b/libc/unistd/Makefile
index 11a33cecf..0d05e6d49 100644
--- a/libc/unistd/Makefile
+++ b/libc/unistd/Makefile
@@ -29,7 +29,7 @@ CSRC=execl.c execlp.c execv.c execvep.c execvp.c execle.c \
sleep.c usleep.c getpass.c sysconf_src.c getlogin.c \
fpathconf.c confstr.c pathconf.c swab.c usershell.c \
getopt.c getsubopt.c
-ifeq ($(strip $(HAS_MMU)),true)
+ifeq ($(strip $(UCLIBC_HAS_MMU)),y)
CSRC+=daemon.c
endif
diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c
index bfad7a363..d4c2e0448 100644
--- a/libc/unistd/daemon.c
+++ b/libc/unistd/daemon.c
@@ -48,6 +48,11 @@ int daemon( int nochdir, int noclose )
if (setsid() == -1)
return(-1);
+ /* Make certain we are not a session leader, or else we
+ * might reacquire a controlling terminal */
+ if (fork())
+ _exit(0);
+
if (!nochdir)
chdir("/");
diff --git a/libc/unistd/fpathconf.c b/libc/unistd/fpathconf.c
index f896e934b..2f6cf7214 100644
--- a/libc/unistd/fpathconf.c
+++ b/libc/unistd/fpathconf.c
@@ -196,7 +196,7 @@ long int fpathconf(int fd, int name)
#endif
case _PC_ASYNC_IO:
-#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAVE_LFS__
+#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAS_LFS__
{
/* AIO is only allowed on regular files and block devices. */
struct stat st;
diff --git a/libc/unistd/pathconf.c b/libc/unistd/pathconf.c
index d7fa99f50..affec4e69 100644
--- a/libc/unistd/pathconf.c
+++ b/libc/unistd/pathconf.c
@@ -200,7 +200,7 @@ long int pathconf(const char *path, int name)
#endif
case _PC_ASYNC_IO:
-#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAVE_LFS__
+#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAS_LFS__
{
/* AIO is only allowed on regular files and block devices. */
struct stat st;