diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/unistd/daemon.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c index 6543f1c11..d71d25480 100644 --- a/libc/unistd/daemon.c +++ b/libc/unistd/daemon.c @@ -123,10 +123,18 @@ int daemon( int nochdir, int noclose ) #else if (!noclose) { - struct stat64 st; +#ifdef __UCLIBC_HAS_LFS__ + struct stat64 st; +#else + struct stat st; +#endif if ((fd = open_not_cancel(_PATH_DEVNULL, O_RDWR, 0)) != -1 +#ifdef __UCLIBC_HAS_LFS__ && (__builtin_expect (fstat64 (fd, &st), 0) == 0)) +#else + && (__builtin_expect (fstat (fd, &st), 0) == 0)) +#endif { if (__builtin_expect (S_ISCHR (st.st_mode), 1) != 0) { #endif |