1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 18:15:17 +00:00

- Fix if_mounted on FreeBSD

- Mention submitter in AUTHORS

Submitted by:	Elisey O. Savateev <bio3k at softboard dot ru>


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@347 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Roman Bogorodskiy 2005-10-16 11:53:36 +00:00
parent ce4572300e
commit ca4dceb2ae
3 changed files with 20 additions and 0 deletions

View File

@ -37,6 +37,9 @@ Dennis Frommknecht
Dennis Kaandorp <addict at quicknet dot nl>
adt746x stuff
Elisey O. Savateev <bio3k at softboard dot ru>
Fixed if_mounted on FreeBSD
Falk Feuersenger <lumberjack at users dot sourceforge dot net>
I2C divisor from a file

View File

@ -303,6 +303,7 @@ static int blockstart[MAX_IF_BLOCK_DEPTH];
int check_mount(char *s)
{
#if defined(__linux__)
int ret = 0;
FILE *mtab = fopen("/etc/mtab", "r");
if (mtab) {
@ -319,6 +320,17 @@ int check_mount(char *s)
ERR("Could not open mtab");
}
return ret;
#elif defined(__FreeBSD__)
struct statfs *mntbuf;
int i, mntsize;
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
for (i = mntsize - 1; i >= 0; i--)
if (strcmp(mntbuf[i].f_mntonname, s) == 0)
return 1;
return 0;
#endif
}

View File

@ -19,6 +19,11 @@
#include <locale.h>
#include <langinfo.h>
#include <wchar.h>
#if defined(__FreeBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/ucred.h>
#endif /* __FreeBSD__ */
#ifdef X11
#if defined(HAVE_CAIRO_H) && defined(HAVE_CAIRO_XLIB_H) && defined(WANT_CAIRO)