Skip to content

Commit

Permalink
Fix build on FreeBSD.
Browse files Browse the repository at this point in the history
The freq_sysctl varaible is being redefined with a different type.

Update the first definition directly.
  • Loading branch information
madpilot78 authored and bi4k8 committed May 17, 2023
1 parent ddddf00 commit 796802b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,13 @@ void get_acpi_fan(char *p_client_buffer, size_t client_buffer_size) {
char get_freq(char *p_client_buffer, size_t client_buffer_size,
const char *p_format, int divisor, unsigned int cpu) {
int freq;
char *freq_sysctl;
char freq_sysctl[16] = {0};

if (!p_client_buffer || client_buffer_size <= 0 || !p_format ||
divisor <= 0) {
return 0;
}

char freq_sysctl[16] = {0};

snprintf(freq_sysctl, sizeof(freq_sysctl), "dev.cpu.%d.freq", (cpu - 1));

if (GETSYSCTL(freq_sysctl, freq) == 0) {
Expand Down

0 comments on commit 796802b

Please sign in to comment.