From: Wayne Davison Date: Fri, 13 May 2005 00:09:35 +0000 (+0000) Subject: - Fixed a return-without-value error. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/4df546ebcb1ce37ac33e7e7dabdf2d1decc347c0 - Fixed a return-without-value error. - Use the new "#ifdef" idiom for the SUPPORT_ACLS defines. - Got rid of some unused-variable compiler warnings when compiling without ACL support. --- diff --git a/acls.diff b/acls.diff index 27d2a5c..4ae2ab6 100644 --- a/acls.diff +++ b/acls.diff @@ -33,8 +33,8 @@ ACLs to a non-ACL-supporting disk should complain. OBJS3=progress.o pipe.o DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ ---- orig/acls.c 2004-10-20 06:36:04 -+++ acls.c 2004-10-20 06:36:04 +--- orig/acls.c 2005-05-12 23:30:45 ++++ acls.c 2005-05-12 23:30:45 @@ -0,0 +1,1130 @@ +/* -*- c-file-style: "linux" -*- + Copyright (C) Andrew Tridgell 1996 @@ -60,7 +60,7 @@ ACLs to a non-ACL-supporting disk should complain. +#include "rsync.h" +#include "lib/sysacls.h" + -+#if SUPPORT_ACLS ++#ifdef SUPPORT_ACLS + +extern int preserve_acls; +extern int am_root; @@ -1193,7 +1193,7 @@ ACLs to a non-ACL-supporting disk should complain. free(file); if (verbose > 1) { ---- orig/configure.in 2005-04-07 17:04:26 +--- orig/configure.in 2005-05-10 23:47:12 +++ configure.in 2004-08-19 19:53:27 @@ -478,6 +478,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no AC_CHECK_LIB(resolv, strcasecmp) @@ -1292,7 +1292,7 @@ ACLs to a non-ACL-supporting disk should complain. if (!file) return NULL; + if (!MAKE_ACL(file, fname)) -+ return; ++ return NULL; maybe_emit_filelist_progress(flist->count + flist_count_offset); @@ -1326,20 +1326,20 @@ ACLs to a non-ACL-supporting disk should complain. /* Now send the uid/gid list. This was introduced in * protocol version 15 */ --- orig/generator.c 2005-04-28 16:26:28 -+++ generator.c 2005-03-11 11:18:22 ++++ generator.c 2005-05-12 23:34:00 @@ -720,6 +720,10 @@ static void recv_generator(char *fname, if (set_perms(fname, file, statret ? NULL : &st, 0) && verbose && code && f_out != -1) rprintf(code, "%s/\n", safe_fname(fname)); -+#if SUPPORT_ACLS ++#ifdef SUPPORT_ACLS + if (f_out == -1) + SET_ACL(fname, file); +#endif if (delete_during && f_out != -1 && !phase && dry_run < 2 && (file->flags & FLAG_DEL_HERE)) delete_in_dir(the_file_list, fname, file); ---- orig/lib/sysacls.c 2004-10-20 15:35:58 -+++ lib/sysacls.c 2004-10-20 15:35:58 +--- orig/lib/sysacls.c 2005-05-12 23:22:36 ++++ lib/sysacls.c 2005-05-12 23:22:36 @@ -0,0 +1,3217 @@ +/* + Unix SMB/CIFS implementation. @@ -4425,49 +4425,49 @@ ACLs to a non-ACL-supporting disk should complain. + +#else /* No ACLs. */ + -+int sys_acl_get_entry( SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p) ++int sys_acl_get_entry(UNUSED(SMB_ACL_T the_acl), UNUSED(int entry_id), UNUSED(SMB_ACL_ENTRY_T *entry_p)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) ++int sys_acl_get_tag_type(UNUSED(SMB_ACL_ENTRY_T entry_d), UNUSED(SMB_ACL_TAG_T *tag_type_p)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) ++int sys_acl_get_permset(UNUSED(SMB_ACL_ENTRY_T entry_d), UNUSED(SMB_ACL_PERMSET_T *permset_p)) +{ + errno = ENOSYS; + return -1; +} + -+void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d) ++void *sys_acl_get_qualifier(UNUSED(SMB_ACL_ENTRY_T entry_d)) +{ + errno = ENOSYS; + return NULL; +} + -+SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type) ++SMB_ACL_T sys_acl_get_file(UNUSED(const char *path_p), UNUSED(SMB_ACL_TYPE_T type)) +{ + errno = ENOSYS; + return (SMB_ACL_T)NULL; +} + -+SMB_ACL_T sys_acl_get_fd(int fd) ++SMB_ACL_T sys_acl_get_fd(UNUSED(int fd)) +{ + errno = ENOSYS; + return (SMB_ACL_T)NULL; +} + -+int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset) ++int sys_acl_clear_perms(UNUSED(SMB_ACL_PERMSET_T permset)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) ++int sys_acl_add_perm( UNUSED(SMB_ACL_PERMSET_T permset), UNUSED(SMB_ACL_PERM_T perm)) +{ + errno = ENOSYS; + return -1; @@ -4479,79 +4479,79 @@ ACLs to a non-ACL-supporting disk should complain. + return (permset & perm) ? 1 : 0; +} + -+char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen) ++char *sys_acl_to_text(UNUSED(SMB_ACL_T the_acl), UNUSED(ssize_t *plen)) +{ + errno = ENOSYS; + return NULL; +} + -+int sys_acl_free_text(char *text) ++int sys_acl_free_text(UNUSED(char *text)) +{ + errno = ENOSYS; + return -1; +} + -+SMB_ACL_T sys_acl_init( int count) ++SMB_ACL_T sys_acl_init(UNUSED(int count)) +{ + errno = ENOSYS; + return NULL; +} + -+int sys_acl_create_entry( SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) ++int sys_acl_create_entry(UNUSED(SMB_ACL_T *pacl), UNUSED(SMB_ACL_ENTRY_T *pentry)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_set_tag_type( SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) ++int sys_acl_set_tag_type(UNUSED(SMB_ACL_ENTRY_T entry), UNUSED(SMB_ACL_TAG_T tagtype)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry, void *qual) ++int sys_acl_set_qualifier(UNUSED(SMB_ACL_ENTRY_T entry), UNUSED(void *qual)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_set_permset( SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) ++int sys_acl_set_permset(UNUSED(SMB_ACL_ENTRY_T entry), UNUSED(SMB_ACL_PERMSET_T permset)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_valid( SMB_ACL_T theacl ) ++int sys_acl_valid(UNUSED(SMB_ACL_T theacl)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_set_file( const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) ++int sys_acl_set_file(UNUSED(const char *name), UNUSED(SMB_ACL_TYPE_T acltype), UNUSED(SMB_ACL_T theacl)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_set_fd( int fd, SMB_ACL_T theacl) ++int sys_acl_set_fd(UNUSED(int fd), UNUSED(SMB_ACL_T theacl)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_delete_def_file(const char *name) ++int sys_acl_delete_def_file(UNUSED(const char *name)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_free_acl(SMB_ACL_T the_acl) ++int sys_acl_free_acl(UNUSED(SMB_ACL_T the_acl)) +{ + errno = ENOSYS; + return -1; +} + -+int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype) ++int sys_acl_free_qualifier(UNUSED(void *qual), UNUSED(SMB_ACL_TAG_T tagtype)) +{ + errno = ENOSYS; + return -1; @@ -4598,7 +4598,7 @@ ACLs to a non-ACL-supporting disk should complain. } --- orig/options.c 2005-05-10 15:32:58 -+++ options.c 2005-02-14 02:46:05 ++++ options.c 2005-05-12 23:34:38 @@ -44,6 +44,7 @@ int keep_dirlinks = 0; int copy_links = 0; int preserve_links = 0; @@ -4659,7 +4659,7 @@ ACLs to a non-ACL-supporting disk should complain. break; + case 'A': -+#if SUPPORT_ACLS ++#ifdef SUPPORT_ACLS + preserve_acls = 1; + preserve_perms = 1; +#else @@ -4706,18 +4706,22 @@ ACLs to a non-ACL-supporting disk should complain. enum logcode code = daemon_log_format_has_i || dry_run ? FCLIENT : FINFO; --- orig/rsync.h 2005-05-03 17:11:01 -+++ rsync.h 2004-07-03 20:11:58 -@@ -638,6 +638,40 @@ struct stats { ++++ rsync.h 2005-05-12 23:32:56 +@@ -638,6 +638,44 @@ struct stats { #include "lib/permstring.h" #include "lib/addrinfo.h" -+#define SUPPORT_ACLS HAVE_POSIX_ACLS|HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|\ -+ HAVE_HPUX_ACLS|HAVE_IRIX_ACLS|HAVE_AIX_ACLS|HAVE_TRU64_ACLS ++#if HAVE_POSIX_ACLS|HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|\ ++ HAVE_HPUX_ACLS|HAVE_IRIX_ACLS|HAVE_AIX_ACLS|HAVE_TRU64_ACLS ++#define SUPPORT_ACLS 1 ++#endif + -+#define ACLS_NEED_MASK HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|HAVE_HPUX_ACLS ++#if HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|HAVE_HPUX_ACLS ++#define ACLS_NEED_MASK 1 ++#endif + -+#if SUPPORT_ACLS -+#if HAVE_SYS_ACL_H ++#ifdef SUPPORT_ACLS ++#ifdef HAVE_SYS_ACL_H +#include +#endif +#define MAKE_ACL(file, fname) make_acl(file, fname) @@ -4748,7 +4752,7 @@ ACLs to a non-ACL-supporting disk should complain. #include "proto.h" /* We have replacement versions of these if they're missing. */ ---- orig/rsync.yo 2005-05-10 16:14:33 +--- orig/rsync.yo 2005-05-10 23:47:12 +++ rsync.yo 2004-07-03 20:11:58 @@ -317,6 +317,7 @@ to the detailed description below for a -H, --hard-links preserve hard links