build: Fix on OpenBSD.

This commit is contained in:
Alastair Poole 2020-06-11 11:57:19 +01:00
parent 73a5305dde
commit 5bfb60cbd6
1 changed files with 6 additions and 0 deletions

View File

@ -182,12 +182,18 @@ filesystem_info_get(const char *path)
fs = calloc(1, sizeof(Filesystem_Info));
fs->mount = strdup(mountpoint);
fs->path = strdup(path);
#if defined(__OpenBSD__)
#else
fs->type = stats.f_type;
#endif
#if defined(__linux__)
fs->type_name = filesystem_type_name(fs->mount);
#else
fs->type_name = strdup(stats.f_fstypename);
#endif
fs->usage.total = stats.f_bsize * stats.f_blocks;
fs->usage.used = fs->usage.total - (stats.f_bsize * stats.f_bfree);