diff options
author | Martin Blapp <mbr@FreeBSD.org> | 2002-03-02 19:15:00 +0000 |
---|---|---|
committer | Martin Blapp <mbr@FreeBSD.org> | 2002-03-02 19:15:00 +0000 |
commit | f7dbd92f23bcad2a3cd986ccb5ee4c987a3549c8 (patch) | |
tree | e9d274bf60ce39987914d448506953fc2aad3888 /editors/openoffice.org-1.0/files/patch-sal::osl::unx::file.c | |
parent | Upgrade to the 25-Feb-2002 GCC 3.1 development snapshot. (diff) |
Add patches merged from NetBSD and from other sources
Diffstat (limited to 'editors/openoffice.org-1.0/files/patch-sal::osl::unx::file.c')
-rw-r--r-- | editors/openoffice.org-1.0/files/patch-sal::osl::unx::file.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/editors/openoffice.org-1.0/files/patch-sal::osl::unx::file.c b/editors/openoffice.org-1.0/files/patch-sal::osl::unx::file.c new file mode 100644 index 000000000000..ade5f14b7946 --- /dev/null +++ b/editors/openoffice.org-1.0/files/patch-sal::osl::unx::file.c @@ -0,0 +1,73 @@ +--- ../sal/osl/unx/file.c.orig Thu Oct 4 15:09:21 2001 ++++ ../sal/osl/unx/file.c +@@ -123,11 +123,16 @@ + #include <ctype.h> + static const sal_Char* MOUNTTAB="/etc/mtab"; + +-#elif defined(NETBSD) ++#elif defined(NETBSD) || defined(FREEBSD) ++#include <sys/param.h> ++#include <sys/ucred.h> + #include <sys/mount.h> + #include <ufs/ufs/quota.h> + #include <ctype.h> +-static const sal_Char* MOUNTTAB="/etc/mtab"; ++#define HAVE_STATFS_H ++/* No mounting table on *BSD ++ * This information is stored only in the kernel. */ ++/* static const sal_Char* MOUNTTAB="/etc/mtab"; */ + + #elif defined(IRIX) + #include <mntent.h> +@@ -137,7 +142,7 @@ + #include <ctype.h> + static const sal_Char* MOUNTTAB="/etc/mtab"; + +-#elif defined(MACOSX) || defined(FREEBSD) ++#elif defined(MACOSX) + #include <ufs/ufs/quota.h> + #include <ctype.h> + static const sal_Char* MOUNTTAB="/etc/mtab"; +@@ -4224,10 +4229,20 @@ + mntfile = fopen(MOUNTTAB,"r"); + #endif /* SOLARIS */ + ++#if defined(NETBSD) || defined(FREEBSD) ++ struct statfs *mntbufp; ++ int mntentries,i; ++ mntentries = getmntinfo(&mntbufp,MNT_WAIT); + + buffer[0] = '\0'; + ++ if(mntentries == 0) ++#else ++ ++ buffer[0] = '\0'; ++ + if ( mntfile == 0 ) ++#endif + { + nRet=errno; + #ifdef DEBUG_OSL_FILE +@@ -4286,7 +4301,21 @@ + } + #endif /* SOLARIS */ + ++#if defined(NETBSD) || defined(FREEBSD) ++ i=0; ++ while ( i < mntentries ) ++ { ++ if ( strcmp(mntbufp[i].f_mntonname,buffer) == 0 ) ++ { ++ *bMountPoint=sal_True; ++ return osl_File_E_None; ++ } ++ i++; ++ } ++#endif ++#if ! ( defined(NETBSD) || defined(FREEBSD) ) + fclose(mntfile); ++#endif + *bMountPoint=sal_False; + return osl_File_E_None; + } |