$NetBSD: patch-ac,v 1.1.1.1 2007/11/27 18:55:40 pooka Exp $ --- src/chironfs.c.orig 2007-11-27 17:00:15.000000000 +0100 +++ src/chironfs.c 2007-11-27 19:08:07.000000000 +0100 @@ -27,8 +27,7 @@ #define FUSE_USE_VERSION 25 #include -#include -#include +#include #include #include #include @@ -43,13 +42,17 @@ #ifdef HAVE_SETXATTR #include #endif +#ifdef __linux__ #include #include -#include #include +#endif +#include #include #include +#include "config.h" + #define _CHIRON_H_ #include "chironfs.h" @@ -186,6 +189,16 @@ } } +char *do_realpath(const char *path, char *resolvedpath) +{ + +#ifndef __linux__ + if (resolvedpath == NULL) + resolvedpath = malloc(PATH_MAX); +#endif + return realpath(path, resolvedpath); +} + //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // @@ -2234,7 +2247,7 @@ return(NULL); } } else { - realbasedir = realpath(basedir,NULL); + realbasedir = do_realpath(basedir,NULL); if (realbasedir==NULL) { free(basedir); return(NULL); @@ -2383,6 +2396,7 @@ dbg(("\nfuse_argv: %s %s %s", fuse_argv[0], fuse_argv[1], fuse_argv[2])); dbg(("\n-------------------------------------------------------------------------------")); +#ifdef HAVE_GETMNTENT FILE *mtab; struct mntent *mntentry; mtab = setmntent("/etc/mtab", "r"); @@ -2393,6 +2407,7 @@ } } while(mntentry!=NULL); endmntent (mtab); +#endif dbg(("\n-------------------------------------------------------------------------------")); res = fuse_main(3, fuse_argv, &chiron_oper);