From e448672db4ca561e4fce9e8401c18d68b4629019 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Wed, 21 Jan 2004 22:13:20 +0000 Subject: [PATCH] OpenBSD support git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@572 423420c4-83ab-492f-b58f-81f9feb106b5 --- disk.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/disk.c b/disk.c index 77af6b1..4ad2d23 100644 --- a/disk.c +++ b/disk.c @@ -82,12 +82,21 @@ #include #include /* errno */ -#ifdef SOLARIS +#if defined(SOLARIS) #include /* solaris statvfs */ #define HAVE_STATVFS +#define F_NAMELEN(buf) ((buf).f_namemax) + +#elif defined(__OpenBSD__) +#include +#include +#define HAVE_STATFS +#define F_NAMELEN(buf) (NAME_MAX) + #else #include /* linux statfs */ #define HAVE_STATFS +#define F_NAMELEN(buf) ((buf).f_namelen) #endif #include "rdesktop.h" @@ -506,10 +515,8 @@ int fsstat(const char *path, struct fsinfo *buf) #if defined(HAVE_STATFS) ret = statfs(path, &statbuf); - buf->f_namelen = statbuf.f_namelen; #elif defined(HAVE_STATVFS) ret = statvfs(path, &statbuf); - buf->f_namelen = statbuf.f_namemax; #else ret=-1; #endif @@ -517,6 +524,7 @@ int fsstat(const char *path, struct fsinfo *buf) buf->f_blocks = statbuf.f_blocks; buf->f_bfree = statbuf.f_bfree; buf->f_bsize = statbuf.f_bsize; + buf->f_namelen = F_NAMELEN(statbuf); return ret; }