mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
More or less working on FreeBSD now.
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1155 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
610b0b628d
commit
00b26c0834
@ -46,7 +46,7 @@ xmms2 = xmms2.c
|
||||
endif
|
||||
|
||||
if BUILD_LINUX
|
||||
linux = linux.c top.c diskio.c
|
||||
linux = linux.c top.c diskio.c users.c
|
||||
PTHREAD_LIBS = -lpthread
|
||||
endif
|
||||
|
||||
@ -117,8 +117,7 @@ conky_SOURCES = \
|
||||
mboxscan.h \
|
||||
$(x11) \
|
||||
$(xmms2) \
|
||||
$(smapi) \
|
||||
users.c
|
||||
$(smapi)
|
||||
|
||||
AM_LDFLAGS = $(PTHREAD_LIBS) -lm
|
||||
|
||||
|
@ -361,12 +361,14 @@ void update_stuff(void)
|
||||
if (NEED(INFO_ENTROPY)) {
|
||||
update_entropy();
|
||||
}
|
||||
#if defined(__linux__)
|
||||
if (NEED(INFO_USERS)) {
|
||||
update_users();
|
||||
}
|
||||
if (NEED(INFO_GW)) {
|
||||
update_gateway_info();
|
||||
}
|
||||
#endif /* __linux__ */
|
||||
if (NEED(INFO_DNS)) {
|
||||
update_dns_data();
|
||||
}
|
||||
|
@ -2656,6 +2656,7 @@ static struct text_object *construct_text_object(const char *s,
|
||||
obj->data.loadavg[0] = (r >= 1) ? (unsigned char) a : 0;
|
||||
free(buf);
|
||||
}
|
||||
#if defined(__linux__)
|
||||
END OBJ(diskio, INFO_DISKIO)
|
||||
if (arg) {
|
||||
obj->data.diskio = prepare_diskio_stat(DEV_NAME(arg));
|
||||
@ -2704,6 +2705,7 @@ static struct text_object *construct_text_object(const char *s,
|
||||
} else {
|
||||
obj->data.diskio = NULL;
|
||||
}
|
||||
#endif
|
||||
END OBJ(color, 0)
|
||||
#ifdef X11
|
||||
obj->data.l = arg ? get_x11_color(arg) : default_fg_color;
|
||||
|
@ -152,15 +152,15 @@ void update_meminfo()
|
||||
int pagesize = getpagesize();
|
||||
|
||||
if (GETSYSCTL("vm.stats.vm.v_page_count", total_pages)) {
|
||||
fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_page_count\"");
|
||||
fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_page_count\"\n");
|
||||
}
|
||||
|
||||
if (GETSYSCTL("vm.stats.vm.v_free_count", free_pages)) {
|
||||
fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_free_count\"");
|
||||
fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_free_count\"\n");
|
||||
}
|
||||
|
||||
if (GETSYSCTL("vm.stats.vm.v_inactive_count", inactive_pages)) {
|
||||
fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_inactive_count\"");
|
||||
fprintf(stderr, "Cannot read sysctl \"vm.stats.vm.v_inactive_count\"\n");
|
||||
}
|
||||
|
||||
info.memmax = total_pages * (pagesize >> 10);
|
||||
@ -714,6 +714,10 @@ void update_diskio()
|
||||
free(statinfo_cur.dinfo);
|
||||
}
|
||||
|
||||
void clear_diskio_stats()
|
||||
{
|
||||
}
|
||||
|
||||
/* While topless is obviously better, top is also not bad. */
|
||||
|
||||
int comparecpu(const void *a, const void *b)
|
||||
|
4
src/fs.c
4
src/fs.c
@ -44,7 +44,7 @@
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_STATFS_F_FSTYPENAME
|
||||
#if !defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) && !defined(__FreeBSD__)
|
||||
#include <mntent.h>
|
||||
#endif
|
||||
|
||||
@ -124,7 +124,7 @@ static void update_fs_stat(struct fs_stat *fs)
|
||||
void get_fs_type(const char *path, char *result)
|
||||
{
|
||||
|
||||
#ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME
|
||||
#if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__FreeBSD__)
|
||||
|
||||
struct statfs s;
|
||||
if (statfs(path, &s) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user