[git commit] Only use fstat64 when LFS is enabled

Austin Foxley austinf at cetoncorp.com
Wed May 20 20:00:07 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=e1888aa26a1ea02436f7c13a1539c67c0e01a12b
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl


Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 libc/unistd/daemon.c       |   10 +++++++++-
 libpthread/nptl/sem_open.c |    5 +++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c
index 6543f1c..d71d254 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
diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c
index aebd4c9..3bada7d 100644
--- a/libpthread/nptl/sem_open.c
+++ b/libpthread/nptl/sem_open.c
@@ -166,8 +166,13 @@ check_add_mapping (const char *name, size_t namelen, int fd, sem_t *existing)
   sem_t *result = SEM_FAILED;
 
   /* Get the information about the file.  */
+#ifdef __UCLIBC_HAS_LFS__
   struct stat64 st;
   if (__fxstat64 (_STAT_VER, fd, &st) == 0)
+#else
+  struct stat st;
+  if (fstat (fd, &st) == 0)
+#endif
     {
       /* Get the lock.  */
       lll_lock (__sem_mappings_lock);
-- 
1.6.0.6


More information about the uClibc-cvs mailing list