[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-894-gc2661ae

Derrell Lipman derrell at samba.org
Sat Feb 14 14:44:57 GMT 2009


The branch, master has been updated
       via  c2661aec24f244c1cf94dca02592b3410b9b6f31 (commit)
       via  352c97561e9de6ccd0102859d18ed15913042622 (commit)
       via  1c9630bf4df4315e0c7b72ac126c43b49f499834 (commit)
      from  6c07b9b7e7f65f4c5b0e347147ed60117c85c6f5 (commit)

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


- Log -----------------------------------------------------------------
commit c2661aec24f244c1cf94dca02592b3410b9b6f31
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Sat Feb 14 09:41:55 2009 -0500

    Check for the right error return value

commit 352c97561e9de6ccd0102859d18ed15913042622
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Fri Feb 13 16:47:54 2009 -0500

    [Bug 6069] Add a fstatvfs function for libsmbclient
    
    - Revert Tim's changes for the moment. I need to see what the issue is and
      arrange to use "struct statvfs" if at all possible.
    
    Derrell

commit 1c9630bf4df4315e0c7b72ac126c43b49f499834
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Fri Feb 13 16:42:26 2009 -0500

    ignore new test program executables

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

Summary of changes:
 .gitignore                           |    2 ++
 examples/libsmbclient/testfstatvfs.c |    3 ++-
 examples/libsmbclient/teststatvfs.c  |    3 ++-
 source3/include/libsmb_internal.h    |    4 ++--
 source3/include/libsmbclient.h       |   25 +++++--------------------
 source3/libsmb/libsmb_compat.c       |    4 ++--
 source3/libsmb/libsmb_stat.c         |    9 +++++----
 7 files changed, 20 insertions(+), 30 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index 703f7e3..f1440ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,8 @@ examples/libsmbclient/testtruncate
 examples/libsmbclient/testutime
 examples/libsmbclient/testwrite
 examples/libsmbclient/tree
+examples/libsmbclient/testfstatvfs
+examples/libsmbclient/teststatvfs
 examples/VFS/config.log
 examples/VFS/config.status
 examples/VFS/configure
diff --git a/examples/libsmbclient/testfstatvfs.c b/examples/libsmbclient/testfstatvfs.c
index 815afac..b4dafef 100644
--- a/examples/libsmbclient/testfstatvfs.c
+++ b/examples/libsmbclient/testfstatvfs.c
@@ -1,4 +1,5 @@
 #include <sys/types.h>
+#include <sys/statvfs.h>
 #include <stdio.h> 
 #include <unistd.h>
 #include <string.h> 
@@ -17,7 +18,7 @@ int main(int argc, char * argv[])
     char *          p;
     char            path[2048];
     struct stat     statbuf;
-    struct smbc_statvfs  statvfsbuf;
+    struct statvfs  statvfsbuf;
     
     smbc_init(get_auth_data_fn, debug); 
     
diff --git a/examples/libsmbclient/teststatvfs.c b/examples/libsmbclient/teststatvfs.c
index b9509d2..8812002 100644
--- a/examples/libsmbclient/teststatvfs.c
+++ b/examples/libsmbclient/teststatvfs.c
@@ -1,4 +1,5 @@
 #include <sys/types.h>
+#include <sys/statvfs.h>
 #include <stdio.h> 
 #include <unistd.h>
 #include <string.h> 
@@ -17,7 +18,7 @@ int main(int argc, char * argv[])
     char *          p;
     char            path[2048];
     struct stat     statbuf;
-    struct smbc_statvfs  statvfsbuf;
+    struct statvfs  statvfsbuf;
     
     smbc_init(get_auth_data_fn, debug); 
     
diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h
index d3683eb..166685c 100644
--- a/source3/include/libsmb_internal.h
+++ b/source3/include/libsmb_internal.h
@@ -506,13 +506,13 @@ SMBC_fstat_ctx(SMBCCTX *context,
 int
 SMBC_statvfs_ctx(SMBCCTX *context,
                  char *path,
-                 struct smbc_statvfs *st);
+                 struct statvfs *st);
 
 
 int
 SMBC_fstatvfs_ctx(SMBCCTX *context,
                   SMBCFILE *file,
-                  struct smbc_statvfs *st);
+                  struct statvfs *st);
 
 
 /* Functions in libsmb_xattr.c */
diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h
index 3bea089..d35d9de 100644
--- a/source3/include/libsmbclient.h
+++ b/source3/include/libsmbclient.h
@@ -75,6 +75,7 @@ extern "C" {
 /* Make sure we have the following includes for now ... */
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/statvfs.h>
 #include <fcntl.h>
 #include <utime.h>
 
@@ -173,22 +174,6 @@ typedef enum smbc_smb_encrypt_level
     SMBC_ENCRYPTLEVEL_REQUIRE   = 2
 } smbc_smb_encrypt_level;
 
-/**
- * Use a system independent statvfs struct for smbclient.
- */
-struct smbc_statvfs {
-	fsblkcnt_t	f_bavail;
-	fsblkcnt_t	f_bfree;
-	fsblkcnt_t	f_blocks;
-	fsfilcnt_t	f_favail;
-	fsfilcnt_t	f_ffree;
-	fsfilcnt_t	f_files;
-	unsigned long	f_bsize;
-	unsigned long	f_flag;
-	unsigned long	f_frsize;
-	unsigned long	f_fsid;
-	unsigned long	f_namemax;
-};
 
 /**
  * Capabilities set in the f_flag field of struct statvfs, from
@@ -887,13 +872,13 @@ void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn);
 
 typedef int (*smbc_statvfs_fn)(SMBCCTX *c,
                                char *path,
-                               struct smbc_statvfs *st);
+                               struct statvfs *st);
 smbc_statvfs_fn smbc_getFunctionStatVFS(SMBCCTX *c);
 void smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn);
 
 typedef int (*smbc_fstatvfs_fn)(SMBCCTX *c,
                                 SMBCFILE *file,
-                                struct smbc_statvfs *st);
+                                struct statvfs *st);
 smbc_fstatvfs_fn smbc_getFunctionFstatVFS(SMBCCTX *c);
 void smbc_setFunctionFstatVFS(SMBCCTX *c, smbc_fstatvfs_fn fn);
 
@@ -1655,7 +1640,7 @@ int smbc_fstat(int fd, struct stat *st);
  */
 int
 smbc_statvfs(char *url,
-             struct smbc_statvfs *st);
+             struct statvfs *st);
 
 /**@ingroup attribute
  * Get file system information via an file descriptor.
@@ -1678,7 +1663,7 @@ smbc_statvfs(char *url,
  */
 int
 smbc_fstatvfs(int fd,
-              struct smbc_statvfs *st);
+              struct statvfs *st);
 
 
 /**@ingroup attribute
diff --git a/source3/libsmb/libsmb_compat.c b/source3/libsmb/libsmb_compat.c
index 95485dc..56d113f 100644
--- a/source3/libsmb/libsmb_compat.c
+++ b/source3/libsmb/libsmb_compat.c
@@ -331,14 +331,14 @@ smbc_fstat(int fd,
 
 int
 smbc_statvfs(char *path,
-             struct smbc_statvfs *st)
+             struct statvfs *st)
 {
         return smbc_getFunctionStatVFS(statcont)(statcont, path, st);
 }
 
 int
 smbc_fstatvfs(int fd,
-              struct smbc_statvfs *st)
+              struct statvfs *st)
 {
 	SMBCFILE * file = find_fd(fd);
         return smbc_getFunctionFstatVFS(statcont)(statcont, file, st);
diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c
index 0ad40e8..3eec15f 100644
--- a/source3/libsmb/libsmb_stat.c
+++ b/source3/libsmb/libsmb_stat.c
@@ -308,7 +308,7 @@ SMBC_fstat_ctx(SMBCCTX *context,
 int
 SMBC_statvfs_ctx(SMBCCTX *context,
                  char *path,
-                 struct smbc_statvfs *st)
+                 struct statvfs *st)
 {
         int             ret;
         bool            bIsDir;
@@ -323,13 +323,14 @@ SMBC_statvfs_ctx(SMBCCTX *context,
         /* Is it a file or a directory?  */
         if (S_ISDIR(statbuf.st_mode)) {
                 /* It's a directory. */
-                if ((pFile = SMBC_opendir_ctx(context, path)) < 0) {
+                if ((pFile = SMBC_opendir_ctx(context, path)) == NULL) {
                         return -1;
                 }
                 bIsDir = true;
         } else if (S_ISREG(statbuf.st_mode)) {
                 /* It's a file. */
-                if ((pFile = SMBC_open_ctx(context, path, O_RDONLY, 0)) < 0) {
+                if ((pFile = SMBC_open_ctx(context, path,
+                                           O_RDONLY, 0)) == NULL) {
                         return -1;
                 }
                 bIsDir = false;
@@ -360,7 +361,7 @@ SMBC_statvfs_ctx(SMBCCTX *context,
 int
 SMBC_fstatvfs_ctx(SMBCCTX *context,
                   SMBCFILE *file,
-                  struct smbc_statvfs *st)
+                  struct statvfs *st)
 {
 	uint32 fs_attrs = 0;
 	struct cli_state *cli = file->srv->cli;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list