$OpenBSD: patch-sal_osl_unx_file_cxx,v 1.2 2006/08/20 03:36:52 kurt Exp $
--- sal/osl/unx/file.cxx.orig.port	Tue Jun 20 00:17:10 2006
+++ sal/osl/unx/file.cxx	Fri Aug 18 15:47:43 2006
@@ -115,7 +115,7 @@ static const sal_Char* MOUNTTAB="/etc/mn
 #include <ctype.h>
 static const sal_Char* MOUNTTAB="/etc/mtab";
 
-#elif defined(NETBSD) || defined(FREEBSD)
+#elif defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD)
 #include <sys/param.h>
 #include <sys/ucred.h>
 #include <sys/mount.h>
@@ -1383,12 +1383,11 @@ oslFileError SAL_CALL osl_syncFile(oslFi
 
 #ifdef HAVE_STATFS_H
 
-#if defined(FREEBSD) || defined(NETBSD) || defined(MACOSX)
+#if defined(FREEBSD) || defined(NETBSD) || defined(MACOSX) || defined(OPENBSD)
 #   define __OSL_STATFS_STRUCT      			struct statfs
 #   define __OSL_STATFS(dir, sfs)   			statfs((dir), (sfs))
 #   define __OSL_STATFS_BLKSIZ(a)   			((sal_uInt64)((a).f_bsize))
 #   define __OSL_STATFS_TYPENAME(a) 			((a).f_fstypename)
-#   define __OSL_STATFS_ISREMOTE(a) 			(((a).f_type & MNT_LOCAL) == 0)
 
 /* always return true if queried for the properties of
    the file system. If you think this is wrong under any
@@ -1407,7 +1406,6 @@ oslFileError SAL_CALL osl_syncFile(oslFi
 #   define __OSL_STATFS_BLKSIZ(a)    			 ((sal_uInt64)((a).f_bsize))
 #   define __OSL_STATFS_IS_NFS(a)     			 (__OSL_NFS_SUPER_MAGIC == (a).f_type) 
 #   define __OSL_STATFS_IS_SMB(a)     			 (__OSL_SMB_SUPER_MAGIC == (a).f_type) 
-#   define __OSL_STATFS_ISREMOTE(a)  			 (__OSL_STATFS_IS_NFS((a)) || __OSL_STATFS_IS_SMB((a)))
 #	define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a)  ((__OSL_MSDOS_SUPER_MAGIC != (a).f_type) && (__OSL_NTFS_SUPER_MAGIC != (a).f_type))
 #	define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) ((__OSL_MSDOS_SUPER_MAGIC != (a).f_type))
 #endif /* LINUX */
@@ -1417,7 +1415,6 @@ oslFileError SAL_CALL osl_syncFile(oslFi
 #   define __OSL_STATFS(dir, sfs)	    		 statvfs((dir), (sfs))
 #   define __OSL_STATFS_BLKSIZ(a)       		 ((sal_uInt64)((a).f_frsize))
 #   define __OSL_STATFS_TYPENAME(a)     		 ((a).f_basetype)
-#   define __OSL_STATFS_ISREMOTE(a)     		 (rtl_str_compare((a).f_basetype, "nfs") == 0)
 
 /* always return true if queried for the properties of
    the file system. If you think this is wrong under any
@@ -1433,7 +1430,6 @@ oslFileError SAL_CALL osl_syncFile(oslFi
 #   define __OSL_STATFS_STRUCT        			 struct dummy {int i;}
 #   define __OSL_STATFS_INIT(a)       			 ((void)0)
 #   define __OSL_STATFS(dir, sfs)     		     (1)
-#   define __OSL_STATFS_ISREMOTE(sfs) 			 (0)
 #	define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a)	 (1)
 #	define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (1)
 #endif /* HAVE_STATFS_H */
@@ -1461,10 +1457,6 @@ static oslFileError osl_psz_getVolumeInf
     /* FIXME: how to detect the kind of storage (fixed, cdrom, ...) */
 	if (uFieldMask & osl_VolumeInfo_Mask_Attributes)
 	{	
-	    if (__OSL_STATFS_ISREMOTE(sfs))
-			pInfo->uAttributes  |= osl_Volume_Attribute_Remote;
-						
-		pInfo->uValidFields |= osl_VolumeInfo_Mask_Attributes;	
 	}
 
 	if (uFieldMask & osl_VolumeInfo_Mask_FileSystemCaseHandling)
@@ -2183,7 +2175,7 @@ int UnicodeToText( char * buffer, size_t
 
     if( nInfo & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL )
     {
-        errno = EOVERFLOW;
+        errno = ENOMEM;
         return 0;
     }
 
@@ -2235,7 +2227,7 @@ int TextToUnicode(
 
     if (nInfo & RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL)
     {
-        errno = EOVERFLOW;
+        errno = ENOMEM;
         return 0;
     }
 
@@ -3360,35 +3352,35 @@ static sal_Bool osl_isFloppyMounted(oslV
  *
  *****************************************************************************/
 
-#if (defined(MACOSX) || defined(NETBSD) || defined(FREEBSD))
+#if (defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD))
 static oslVolumeDeviceHandle osl_isFloppyDrive(const sal_Char* pszPath)
 {
     return NULL;
 }
 #endif /* MACOSX */
 
-#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD))
+#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD))
 static oslFileError osl_mountFloppy(oslVolumeDeviceHandle hFloppy)
 {
     return osl_File_E_BUSY;
 }
 #endif /* MACOSX */
 
-#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD))
+#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD))
 static oslFileError osl_unmountFloppy(oslVolumeDeviceHandle hFloppy)
 {
     return osl_File_E_BUSY;
 }
 #endif /* MACOSX */
 
-#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD))
+#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD))
 static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem)
 {
     return sal_False;
 }
 #endif /* MACOSX */
 
-#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD))
+#if ( defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD))
 static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice)
 {
     return sal_False;
