Browse Source

Fixed compile bugs having to do with 64-bit filesystem operations that
need to be disabled when 'DOLFS' is disabled.

"Steven J. Hill" 23 years ago
parent
commit
ccc481bbb0
2 changed files with 13 additions and 0 deletions
  1. 4 0
      libc/misc/statfs/Makefile
  2. 9 0
      libc/sysdeps/linux/common/getdirname.c

+ 4 - 0
libc/misc/statfs/Makefile

@@ -22,7 +22,11 @@
 TOPDIR=../../../
 TOPDIR=../../../
 include $(TOPDIR)Rules.mak
 include $(TOPDIR)Rules.mak
 
 
+ifeq ($(strip $(__UCLIBC_HAVE_LFS__)),true)
 CSRC = fstatfs64.c statfs64.c statvfs.c statvfs64.c fstatvfs.c fstatvfs64.c
 CSRC = fstatfs64.c statfs64.c statvfs.c statvfs64.c fstatvfs.c fstatvfs64.c
+else
+CSRC = statvfs.c fstatvfs.c
+endif
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 OBJS=$(COBJS)
 
 

+ 9 - 0
libc/sysdeps/linux/common/getdirname.c

@@ -30,12 +30,21 @@ char *
 get_current_dir_name (void)
 get_current_dir_name (void)
 {
 {
 	char *pwd;
 	char *pwd;
+#ifdef __USE_LARGEFILE64
 	struct stat64 dotstat, pwdstat;
 	struct stat64 dotstat, pwdstat;
+#else
+	struct stat dotstat, pwdstat;
+#endif
 
 
 	pwd = getenv ("PWD");
 	pwd = getenv ("PWD");
 	if (pwd != NULL
 	if (pwd != NULL
+#ifdef __USE_LARGEFILE64
 		&& stat64 (".", &dotstat) == 0
 		&& stat64 (".", &dotstat) == 0
 		&& stat64 (pwd, &pwdstat) == 0
 		&& stat64 (pwd, &pwdstat) == 0
+#else
+		&& stat (".", &dotstat) == 0
+		&& stat (pwd, &pwdstat) == 0
+#endif
 		&& pwdstat.st_dev == dotstat.st_dev
 		&& pwdstat.st_dev == dotstat.st_dev
 		&& pwdstat.st_ino == dotstat.st_ino)
 		&& pwdstat.st_ino == dotstat.st_ino)
 		/* The PWD value is correct.  Use it.  */
 		/* The PWD value is correct.  Use it.  */