mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
Fix ${freq} and ${freq_g} on FreeBSD.
Reported by: Karsten Rothemund <karsten@photor.de> git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@804 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
03d0ad83b8
commit
de84fcac2a
@ -1995,8 +1995,7 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
|
|||||||
OBJ(acpitemp, 0) obj->data.i = open_acpi_temperature(arg);
|
OBJ(acpitemp, 0) obj->data.i = open_acpi_temperature(arg);
|
||||||
END OBJ(acpitempf, 0) obj->data.i = open_acpi_temperature(arg);
|
END OBJ(acpitempf, 0) obj->data.i = open_acpi_temperature(arg);
|
||||||
END OBJ(acpiacadapter, 0)
|
END OBJ(acpiacadapter, 0)
|
||||||
#if defined(__linux__)
|
END OBJ(freq, 0)
|
||||||
END OBJ(freq, 0)
|
|
||||||
get_cpu_count();
|
get_cpu_count();
|
||||||
if (!arg
|
if (!arg
|
||||||
|| !isdigit(arg[0])
|
|| !isdigit(arg[0])
|
||||||
@ -2028,6 +2027,7 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
|
|||||||
obj->data.cpu_index=atoi(&arg[0]);
|
obj->data.cpu_index=atoi(&arg[0]);
|
||||||
}
|
}
|
||||||
obj->a = 1;
|
obj->a = 1;
|
||||||
|
#if defined(__linux__)
|
||||||
END OBJ(voltage_mv, 0)
|
END OBJ(voltage_mv, 0)
|
||||||
get_cpu_count();
|
get_cpu_count();
|
||||||
if (!arg
|
if (!arg
|
||||||
|
@ -514,7 +514,7 @@ get_freq(char *p_client_buffer, size_t client_buffer_size,
|
|||||||
if (freq_sysctl == NULL)
|
if (freq_sysctl == NULL)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
||||||
snprintf(freq_sysctl, 16, "dev.cpu.%d.freq", cpu);
|
snprintf(freq_sysctl, 16, "dev.cpu.%d.freq", (cpu - 1));
|
||||||
|
|
||||||
if (!p_client_buffer || client_buffer_size <= 0 ||
|
if (!p_client_buffer || client_buffer_size <= 0 ||
|
||||||
!p_format || divisor <= 0)
|
!p_format || divisor <= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user