diff options
Diffstat (limited to 'libc/unistd')
-rw-r--r-- | libc/unistd/Makefile | 2 | ||||
-rw-r--r-- | libc/unistd/daemon.c | 5 | ||||
-rw-r--r-- | libc/unistd/fpathconf.c | 2 | ||||
-rw-r--r-- | libc/unistd/pathconf.c | 2 |
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; |