diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2015-07-06 15:40:30 +0200 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2015-07-06 15:48:39 +0200 |
commit | 80e7b83d541044c698d6e9e40cc122e0cf287858 (patch) | |
tree | 8de541c9dffaaf20f078807ca6489e6cbf211301 | |
parent | 2113737107c537e9cbc1a40d2d8d5fac5152e03e (diff) |
Add ifdef to compile print_disk_info on Mac
-rw-r--r-- | src/print_disk_info.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/print_disk_info.c b/src/print_disk_info.c index 7fd47b9..e5e3ab1 100644 --- a/src/print_disk_info.c +++ b/src/print_disk_info.c @@ -7,7 +7,7 @@ #include <sys/stat.h> #include <sys/statvfs.h> #include <sys/types.h> -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (__OpenBSD__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) #include <sys/param.h> #include <sys/mount.h> #else @@ -59,7 +59,7 @@ static int print_bytes_human(char *outwalk, uint64_t bytes, const char *prefix_t * Determines whether remaining bytes are below given threshold. * */ -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) static bool below_threshold(struct statfs buf, const char *prefix_type, const char *threshold_type, const double low_threshold) { #else static bool below_threshold(struct statvfs buf, const char *prefix_type, const char *threshold_type, const double low_threshold) { @@ -116,7 +116,7 @@ void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const ch INSTANCE(path); -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) struct statfs buf; if (statfs(path, &buf) == -1) |