got rid of SMB_STRUCT_STATVFS. I don't think we should be defining
authorAndrew Tridgell <tridge@samba.org>
Fri, 18 Sep 1998 03:53:14 +0000 (03:53 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 18 Sep 1998 03:53:14 +0000 (03:53 +0000)
structures that only apply on some platforms.

source/include/includes.h
source/include/proto.h
source/lib/system.c
source/smbd/dfree.c

index 9b6e6266dc7dad3c06b364a6c60fa031856c5c1c..62c044603d75dc0f52954fc60ebeb64aeadec7c9 100644 (file)
 #  endif
 #endif
 
-/*
- * Type for statvfs structure.
- * Unfortunately, due to the make proto structure
- * we still need to define this as void * for platforms
- * that don't have either statvfs or statvfs64. JRA.
- */
-
-#ifndef SMB_STRUCT_STATVFS
-#  if defined(STAT_STATVFS64)
-#    define SMB_STRUCT_STATVFS struct statvfs64
-#  elif defined(STAT_STATVFS)
-#    define SMB_STRUCT_STATVFS struct statvfs
-#  else
-#    define SMB_STRUCT_STATVFS void *
-#  endif
-#endif
-
 /*
  * Defines for 64 bit fcntl locks.
  */
index d19188f8efd177003d7be6a308d71080aa38f688..0df682c4e36178d8c456cd62fced8411552fdf9e 100644 (file)
@@ -158,7 +158,6 @@ int sys_select(int maxfd, fd_set *fds,struct timeval *tval);
 int sys_stat(char *fname,SMB_STRUCT_STAT *sbuf);
 int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
 int sys_lstat(char *fname,SMB_STRUCT_STAT *sbuf);
-int sys_statvfs( const char *path, SMB_STRUCT_STATVFS *fsd);
 int sys_ftruncate(int fd, SMB_OFF_T offset);
 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
index 52be504c528a6c590933557bf89057cb48203217..c3d97e0350f397dd630df055a71970a8de57f6ee 100644 (file)
@@ -178,21 +178,6 @@ int sys_lstat(char *fname,SMB_STRUCT_STAT *sbuf)
 #endif
 }
 
-/*******************************************************************
- An statvfs() wrapper that will deal with 64 bit filesizes.
-********************************************************************/
-
-int sys_statvfs( const char *path, SMB_STRUCT_STATVFS *fsd)
-{
-#if defined(STAT_STATVFS64)
-  return statvfs64(path, fsd);
-#elif defined(STAT_STATVFS)
-  return statvfs(path, fsd);
-#else
-  return -1;
-#endif
-}
-
 /*******************************************************************
  An ftruncate() wrapper that will deal with 64 bit filesizes.
 ********************************************************************/
index 499d0892604991c80b5ff162d901818bba3826c2..c96a599e77b0281733bd31a96c9e17f47c70b3e9 100644 (file)
@@ -156,10 +156,14 @@ static int fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
 # define CONVERT_BLOCKS(B) \
        adjust_blocks ((SMB_BIG_UINT)(B), fsd.f_frsize ? (SMB_BIG_UINT)fsd.f_frsize : (SMB_BIG_UINT)fsd.f_bsize, (SMB_BIG_UINT)512)
 
-       SMB_STRUCT_STATVFS fsd;
+#ifdef STAT_STATVFS64
+       struct statvfs64 fsd;
+       if (statvfs64(path, &fsd) < 0) return -1;
+#else
+       struct statvfs fsd;
+       if (statvfs(path, &fsd) < 0) return -1;
+#endif
 
-       if (sys_statvfs (path, &fsd) < 0)
-               return -1;
        /* f_frsize isn't guaranteed to be supported.  */
 
 #endif /* STAT_STATVFS */