Commit 86a8f4cd authored by Alexandre Julliard's avatar Alexandre Julliard

Check that we have statfs before using it.

parent 63fae645
......@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
......@@ -43,6 +44,7 @@
int statvfs( const char *path, struct statvfs *buf )
{
int ret;
#ifdef HAVE_STATFS
struct statfs info;
/* FIXME: add autoconf check for this */
......@@ -86,6 +88,10 @@ int statvfs( const char *path, struct statvfs *buf )
buf->f_favail = info.f_ffree;
#endif
}
#else /* HAVE_STATFS */
ret = -1;
errno = ENOSYS;
#endif /* HAVE_STATFS */
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment