OpenBSD support

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@572 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Michael Gernoth 2004-01-21 22:13:20 +00:00
parent 22248b26bc
commit e448672db4

14
disk.c
View File

@ -82,12 +82,21 @@
#include <fnmatch.h> #include <fnmatch.h>
#include <errno.h> /* errno */ #include <errno.h> /* errno */
#ifdef SOLARIS #if defined(SOLARIS)
#include <sys/statvfs.h> /* solaris statvfs */ #include <sys/statvfs.h> /* solaris statvfs */
#define HAVE_STATVFS #define HAVE_STATVFS
#define F_NAMELEN(buf) ((buf).f_namemax)
#elif defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#define HAVE_STATFS
#define F_NAMELEN(buf) (NAME_MAX)
#else #else
#include <sys/vfs.h> /* linux statfs */ #include <sys/vfs.h> /* linux statfs */
#define HAVE_STATFS #define HAVE_STATFS
#define F_NAMELEN(buf) ((buf).f_namelen)
#endif #endif
#include "rdesktop.h" #include "rdesktop.h"
@ -506,10 +515,8 @@ int fsstat(const char *path, struct fsinfo *buf)
#if defined(HAVE_STATFS) #if defined(HAVE_STATFS)
ret = statfs(path, &statbuf); ret = statfs(path, &statbuf);
buf->f_namelen = statbuf.f_namelen;
#elif defined(HAVE_STATVFS) #elif defined(HAVE_STATVFS)
ret = statvfs(path, &statbuf); ret = statvfs(path, &statbuf);
buf->f_namelen = statbuf.f_namemax;
#else #else
ret=-1; ret=-1;
#endif #endif
@ -517,6 +524,7 @@ int fsstat(const char *path, struct fsinfo *buf)
buf->f_blocks = statbuf.f_blocks; buf->f_blocks = statbuf.f_blocks;
buf->f_bfree = statbuf.f_bfree; buf->f_bfree = statbuf.f_bfree;
buf->f_bsize = statbuf.f_bsize; buf->f_bsize = statbuf.f_bsize;
buf->f_namelen = F_NAMELEN(statbuf);
return ret; return ret;
} }