mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-15 17:47:09 +00:00
Fix build errors under FreeBSD
Makefile.am: top.c was enlisted as Linux-only source, though it is required for conky on every operating system. conky.[ch]: top_running definition was inside #ifdef __linux__, though required by top.c on every operating system. freebsd.c: Change return type of update_*() to int, as required by common.h; remove free_all_processes() as it is defined by top.c. The changes done to freebsd.c must be done to netbsd.c and openbsd.c, too. I did not do it as I have no opportunity to test conky under NetBSD or OpenBSD. Signed-off-by: Alexander Graf <agraf@znc.in>
This commit is contained in:
parent
8564ff6610
commit
a44b3c3f47
@ -56,7 +56,7 @@ mandatory_sources = colours.c colours.h combine.c combine.h common.c common.h \
|
||||
mboxscan.h read_tcp.c read_tcp.h scroll.c scroll.h specials.c \
|
||||
specials.h tailhead.c tailhead.h temphelper.c temphelper.h \
|
||||
text_object.c text_object.h timeinfo.c timeinfo.h algebra.c \
|
||||
algebra.h proc.c proc.h user.c user.h
|
||||
algebra.h proc.c proc.h user.c user.h top.c top.h
|
||||
|
||||
# source files only needed when the apropriate option is enabled
|
||||
audacious = audacious.c audacious.h
|
||||
@ -65,7 +65,7 @@ ibm = ibm.c ibm.h smapi.c smapi.h
|
||||
mpd = mpd.c mpd.h libmpdclient.c libmpdclient.h
|
||||
moc = moc.c moc.h
|
||||
xmms2 = xmms2.c xmms2.h
|
||||
linux = linux.c linux.h top.c top.h users.c sony.c sony.h i8k.c i8k.h
|
||||
linux = linux.c linux.h users.c sony.c sony.h i8k.c i8k.h
|
||||
solaris = solaris.c
|
||||
freebsd = freebsd.c freebsd.h
|
||||
netbsd = netbsd.c netbsd.h
|
||||
|
@ -166,9 +166,7 @@ int top_cpu, top_mem, top_time;
|
||||
#ifdef IOSTATS
|
||||
int top_io;
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
int top_running;
|
||||
#endif
|
||||
int output_methods;
|
||||
static int extra_newline;
|
||||
enum x_initialiser_state x_initialised = NO;
|
||||
|
@ -296,9 +296,7 @@ extern int top_cpu, top_mem, top_time;
|
||||
#ifdef IOSTATS
|
||||
extern int top_io;
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
extern int top_running;
|
||||
#endif
|
||||
|
||||
/* defined in conky.c, needed by top.c */
|
||||
extern int cpu_separate;
|
||||
|
@ -118,7 +118,7 @@ void prepare_update(void)
|
||||
{
|
||||
}
|
||||
|
||||
void update_uptime(void)
|
||||
int update_uptime(void)
|
||||
{
|
||||
int mib[2] = { CTL_KERN, KERN_BOOTTIME };
|
||||
struct timeval boottime;
|
||||
@ -133,6 +133,8 @@ void update_uptime(void)
|
||||
fprintf(stderr, "Could not get uptime\n");
|
||||
info.uptime = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int check_mount(char *s)
|
||||
@ -150,7 +152,7 @@ int check_mount(char *s)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void update_meminfo(void)
|
||||
int update_meminfo(void)
|
||||
{
|
||||
u_int total_pages, inactive_pages, free_pages;
|
||||
unsigned long swap_avail, swap_free;
|
||||
@ -182,9 +184,11 @@ void update_meminfo(void)
|
||||
info.swap = 0;
|
||||
info.swapfree = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void update_net_stats(void)
|
||||
int update_net_stats(void)
|
||||
{
|
||||
struct net_stat *ns;
|
||||
double delta;
|
||||
@ -195,11 +199,11 @@ void update_net_stats(void)
|
||||
/* get delta */
|
||||
delta = current_update_time - last_update_time;
|
||||
if (delta <= 0.0001) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (getifaddrs(&ifap) < 0) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
|
||||
@ -255,18 +259,20 @@ void update_net_stats(void)
|
||||
}
|
||||
|
||||
freeifaddrs(ifap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void update_total_processes(void)
|
||||
int update_total_processes(void)
|
||||
{
|
||||
int n_processes;
|
||||
|
||||
kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
|
||||
|
||||
info.procs = n_processes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void update_running_processes(void)
|
||||
int update_running_processes(void)
|
||||
{
|
||||
struct kinfo_proc *p;
|
||||
int n_processes;
|
||||
@ -284,6 +290,7 @@ void update_running_processes(void)
|
||||
}
|
||||
|
||||
info.run_procs = cnt;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void get_cpu_count(void)
|
||||
@ -309,7 +316,7 @@ struct cpu_info {
|
||||
long oldused;
|
||||
};
|
||||
|
||||
void update_cpu_usage(void)
|
||||
int update_cpu_usage(void)
|
||||
{
|
||||
int i, j = 0;
|
||||
long used, total;
|
||||
@ -387,9 +394,10 @@ void update_cpu_usage(void)
|
||||
}
|
||||
|
||||
free(cp_time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void update_load_average(void)
|
||||
int update_load_average(void)
|
||||
{
|
||||
double v[3];
|
||||
|
||||
@ -398,6 +406,8 @@ void update_load_average(void)
|
||||
info.loadavg[0] = (double) v[0];
|
||||
info.loadavg[1] = (double) v[1];
|
||||
info.loadavg[2] = (double) v[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
double get_acpi_temperature(int fd)
|
||||
@ -578,9 +588,10 @@ char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_fo
|
||||
return 1;
|
||||
}
|
||||
|
||||
void update_top(void)
|
||||
int update_top(void)
|
||||
{
|
||||
proc_find_top(info.cpu, info.memu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -638,7 +649,7 @@ cleanup:
|
||||
}
|
||||
#endif
|
||||
|
||||
void update_diskio(void)
|
||||
int update_diskio(void)
|
||||
{
|
||||
int devs_count, num_selected, num_selections, dn;
|
||||
struct device_selection *dev_select = NULL;
|
||||
@ -656,7 +667,7 @@ void update_diskio(void)
|
||||
|
||||
if (devstat_getdevs(NULL, &statinfo_cur) < 0) {
|
||||
free(statinfo_cur.dinfo);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
devs_count = statinfo_cur.dinfo->numdevs;
|
||||
@ -688,6 +699,7 @@ void update_diskio(void)
|
||||
}
|
||||
|
||||
free(statinfo_cur.dinfo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* While topless is obviously better, top is also not bad. */
|
||||
@ -954,8 +966,3 @@ int get_entropy_poolsize(unsigned int *val)
|
||||
(void)val;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* empty stub so conky links */
|
||||
void free_all_processes(void)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user