diff --git a/aegisub/libaegisub/include/libaegisub/util.h b/aegisub/libaegisub/include/libaegisub/util.h index d21b606e5..b9e2161b1 100644 --- a/aegisub/libaegisub/include/libaegisub/util.h +++ b/aegisub/libaegisub/include/libaegisub/util.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #endif // LAGI_PRE diff --git a/aegisub/libaegisub/lagi_pre.h b/aegisub/libaegisub/lagi_pre.h index 164d61f37..74d051b33 100644 --- a/aegisub/libaegisub/lagi_pre.h +++ b/aegisub/libaegisub/lagi_pre.h @@ -26,7 +26,7 @@ // Unix C #ifndef _WIN32 -# include // yep, this exists on MacOS X as well, but not on Windows. +# include #endif // Common C++ diff --git a/aegisub/libaegisub/unix/util.cpp b/aegisub/libaegisub/unix/util.cpp index ecc8bb289..691b796e3 100644 --- a/aegisub/libaegisub/unix/util.cpp +++ b/aegisub/libaegisub/unix/util.cpp @@ -60,7 +60,7 @@ void time_log(timeval &tv) { } uint64_t freespace(std::string &path, PathType type) { - struct statfs fs; + struct statvfs fs; std::string check(path); if (type == TypeFile) @@ -68,7 +68,7 @@ uint64_t freespace(std::string &path, PathType type) { acs::CheckDirRead(check); - if ((statfs(check.c_str(), &fs)) == 0) { + if ((statvfs(check.c_str(), &fs)) == 0) { return fs.f_bsize * fs.f_bavail; } else { /// @todo We need a collective set of exceptions for ENOTDIR, EIO etc.