cvs: php4 / configure.in /ext/standard filestat.c
| From: | Jon Parise | Date: | Tue, 22 May 2001 02:45:04 +0000 |
| Subject: | cvs: php4 / configure.in /ext/standard filestat.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-5922@lists.php.net to get a copy of this message | ||
jon Mon May 21 19:45:04 2001 EDT
Modified files:
/php4 configure.in
/php4/ext/standard filestat.c
Log:
@ - Fix disk_free_space() and disk_total_space() under FreeBSD. (jon)
FreeBSD defines statfs(2) in <sys/mount.h>. Teach PHP to look for it there.
Index: php4/configure.in
diff -u php4/configure.in:1.251 php4/configure.in:1.252
--- php4/configure.in:1.251 Sat May 19 15:21:40 2001
+++ php4/configure.in Mon May 21 19:45:03 2001
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.251 2001/05/19 22:21:40 sniper Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.252 2001/05/22 02:45:03 jon Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -303,6 +303,7 @@
sysexits.h \
sys/file.h \
sys/mman.h \
+sys/mount.h \
sys/resource.h \
sys/select.h \
sys/socket.h \
Index: php4/ext/standard/filestat.c
diff -u php4/ext/standard/filestat.c:1.67 php4/ext/standard/filestat.c:1.68
--- php4/ext/standard/filestat.c:1.67 Tue May 15 16:43:18 2001
+++ php4/ext/standard/filestat.c Mon May 21 19:45:04 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.67 2001/05/15 23:43:18 jon Exp $ */
+/* $Id: filestat.c,v 1.68 2001/05/22 02:45:04 jon Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -43,6 +43,8 @@
# include <sys/statvfs.h>
#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS)
# include <sys/statfs.h>
+#elif defined(HAVE_SYS_MOUNT_H) && defined(HAVE_STATFS)
+# include <sys/mount.h>
#endif
#if HAVE_PWD_H
@@ -151,7 +153,7 @@
#else /* not - WINDOWS */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
struct statvfs buf;
-#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS)
+#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
struct statfs buf;
#endif
double bytestotal = 0;
@@ -215,7 +217,7 @@
bytestotal = (((double)buf.f_blocks) * ((double)buf.f_bsize));
}
-#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS)
+#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs((*path)->value.str.val,&buf)) RETURN_FALSE;
bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks));
#endif
@@ -252,7 +254,7 @@
#else /* not - WINDOWS */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
struct statvfs buf;
-#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS)
+#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
struct statfs buf;
#endif
double bytesfree = 0;
@@ -315,7 +317,7 @@
} else {
bytesfree = (((double)buf.f_bavail) * ((double)buf.f_bsize));
}
-#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS)
+#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs((*path)->value.str.val,&buf)) RETURN_FALSE;
bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bavail));
#endif