In NetWare statfs f_bavail member is known as f_bfree

This commit is contained in:
Anantha Kesari H Y 2005-02-21 09:08:54 +00:00
parent 8d73dc7bfc
commit f43386764f

View File

@ -311,8 +311,12 @@ PHP_FUNCTION(disk_free_space)
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
#ifdef NETWARE
bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bfree));
#else
bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bavail));
#endif
#endif
#endif /* WINDOWS */
RETURN_DOUBLE(bytesfree);