diff --git a/src/print_battery_info.c b/src/print_battery_info.c index fad8bab..7465d17 100644 --- a/src/print_battery_info.c +++ b/src/print_battery_info.c @@ -595,7 +595,7 @@ void print_battery_info(battery_info_ctx_t *ctx) { #endif #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__OpenBSD__) /* These OSes report battery time in minutes. */ - hide_seconds = true; + ctx->hide_seconds = true; #endif if (ctx->number < 0) { diff --git a/src/print_disk_info.c b/src/print_disk_info.c index f1c2f09..ec19c8f 100644 --- a/src/print_disk_info.c +++ b/src/print_disk_info.c @@ -63,7 +63,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__) || defined(__APPLE__) +#if 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) { @@ -124,17 +124,17 @@ void print_disk_info(disk_info_ctx_t *ctx) { INSTANCE(ctx->path); -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) +#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) struct statfs buf; if (statfs(path, &buf) == -1) return; mounted = true; -#elif defined(__NetBSD__) +#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct statvfs buf; - if (statvfs(path, &buf) == -1) + if (statvfs(ctx->path, &buf) == -1) return; mounted = true; diff --git a/src/print_volume.c b/src/print_volume.c index e936d1a..dfe7f51 100644 --- a/src/print_volume.c +++ b/src/print_volume.c @@ -250,8 +250,8 @@ void print_volume(volume_ctx_t *ctx) { const char *devicename = "UNSUPPORTED"; /* TODO: implement support for this */ pbval = 1; - if (mixer_idx > 0) - asprintf(&mixerpath, "/dev/mixer%d", mixer_idx); + if (ctx->mixer_idx > 0) + asprintf(&mixerpath, "/dev/mixer%d", ctx->mixer_idx); else mixerpath = defaultmixer; @@ -264,7 +264,7 @@ void print_volume(volume_ctx_t *ctx) { goto out; } - if (mixer_idx > 0) + if (ctx->mixer_idx > 0) free(mixerpath); #if defined(__NetBSD__) || defined(__OpenBSD__) @@ -351,7 +351,7 @@ void print_volume(volume_ctx_t *ctx) { } #endif - buffer = apply_volume_format(fmt, buffer, vol & 0x7f, devicename); + ctx->buf = apply_volume_format(ctx->fmt, vol & 0x7f, devicename); close(mixfd); goto out_with_format; #endif