diff options
author | Kamil Rytarowski <n54@gmx.com> | 2016-07-05 15:22:22 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-10-04 22:16:35 +0200 |
commit | 5b1b3a76b5e54136c614a4ead2f358a9439fb3af (patch) | |
tree | 8d846a08cba8bf5e752deeacb8299efc983fd6bd /libs/ardour/session_state.cc | |
parent | f9c83a04f1431c3f3a69e0c374d9187c78281825 (diff) |
Detect free space on NetBSD
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 0d385bf56a..ec98908a54 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2285,7 +2285,7 @@ Session::save_template (string template_name, bool replace_existing) void Session::refresh_disk_space () { -#if __APPLE__ || __FreeBSD__ || (HAVE_SYS_VFS_H && HAVE_SYS_STATVFS_H) +#if __APPLE__ || __FreeBSD__ || __NetBSD__ || (HAVE_SYS_VFS_H && HAVE_SYS_STATVFS_H) Glib::Threads::Mutex::Lock lm (space_lock); @@ -2295,10 +2295,15 @@ Session::refresh_disk_space () _total_free_4k_blocks_uncertain = false; for (vector<space_and_path>::iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) { +#if defined(__NetBSD__) + struct statvfs statfsbuf; + statvfs (i->path.c_str(), &statfsbuf); +#else struct statfs statfsbuf; - statfs (i->path.c_str(), &statfsbuf); + statfs (i->path.c_str(), &statfsbuf); +#endif double const scale = statfsbuf.f_bsize / 4096.0; /* See if this filesystem is read-only */ |