[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Feb 25 20:20:02 MST 2011


The branch, master has been updated
       via  c8a242d dirfd doesn't exist in some platforms.
       via  ebb2fb7 Removed unused code check_dos_char_slowly.
      from  242a63e s3: Fix a 64-bit warning in vfs_gpfs.c

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c8a242d9fcb16df41a36b67ce2a8d43a3853b103
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Feb 25 17:25:36 2011 -0800

    dirfd doesn't exist in some platforms.
    
    Hack that should get the buildfarm back to green.
    Ensure dirfd() needs to be defined before we properly return fdopendir.
    This will do until we get a proper dirfd() defined in libreplace.
    
    From http://www.gnu.org/software/hello/manual/gnulib/dirfd.html
    
    This function is missing on some platforms: AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 10, mingw.
    
    Jeremy.
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Sat Feb 26 04:19:55 CET 2011 on sn-devel-104

commit ebb2fb7efb1beea63720d3753685bb2eab5f19ee
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Feb 25 17:25:20 2011 -0800

    Removed unused code check_dos_char_slowly.

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/system.c      |    6 ++++--
 source3/lib/util_unistr.c |   17 -----------------
 source3/smbd/dir.c        |    6 ++++++
 3 files changed, 10 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/system.c b/source3/lib/system.c
index 24d3c09..092287a 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -868,13 +868,15 @@ SMB_STRUCT_DIR *sys_opendir(const char *name)
 
 /*******************************************************************
  An fdopendir wrapper that will deal with 64 bit filesizes.
+ Ugly hack - we need dirfd for this to work correctly in the
+ calling code.. JRA.
 ********************************************************************/
 
 SMB_STRUCT_DIR *sys_fdopendir(int fd)
 {
-#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_FDOPENDIR64)
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_FDOPENDIR64) && defined(HAVE_DIRFD)
 	return fdopendir64(fd);
-#elif defined(HAVE_FDOPENDIR)
+#elif defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD)
 	return fdopendir(fd);
 #else
 	errno = ENOSYS;
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 02a95bd..14b5a87 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -42,23 +42,6 @@ void gfree_case_tables(void)
 	initialized = false;
 }
 
-static int check_dos_char_slowly(smb_ucs2_t c)
-{
-	char buf[10];
-	smb_ucs2_t c2 = 0;
-	int len1, len2;
-
-	len1 = convert_string(CH_UTF16LE, CH_DOS, &c, 2, buf, sizeof(buf),False);
-	if (len1 == 0) {
-		return 0;
-	}
-	len2 = convert_string(CH_DOS, CH_UTF16LE, buf, len1, &c2, 2,False);
-	if (len2 != 2) {
-		return 0;
-	}
-	return (c == c2);
-}
-
 /**
  * Load the valid character map table from <tt>valid.dat</tt> or
  * create from the configured codepage.
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 5c502f7..b9791e9 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -570,10 +570,16 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
 void dptr_CloseDir(files_struct *fsp)
 {
 	if (fsp->dptr) {
+/*
+ * Ugly hack. We have defined fdopendir to return ENOSYS if dirfd also isn't
+ * present. I hate Solaris. JRA.
+ */
+#ifdef HAVE_DIRFD
 		if (fsp->fh->fd == dirfd(fsp->dptr->dir_hnd->dir)) {
 			/* The call below closes the underlying fd. */
 			fsp->fh->fd = -1;
 		}
+#endif
 		dptr_close_internal(fsp->dptr);
 		fsp->dptr = NULL;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list