From 07beaf87b0e3bfe2b33f65a9b29cca37f214429c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Jun 2008 20:11:23 +0200 Subject: [PATCH] Trivial stylistic improvements. --- ChangeLog | 5 +++++ lib/copy-acl.c | 8 ++++---- lib/set-mode-acl.c | 10 +++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7219dd03..a98bf7c9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-06-07 Bruno Haible + * lib/copy-acl.c (qcopy_acl): Make the #if branches independent. + * lib/set-mode-acl.c (qset_acl): Choose better local variable names. + +2008-06-07 Bruno Haible + * doc/posix-functions/_setjmp.texi: Explain the use of this function regardless of POSIX. * doc/posix-functions/_longjmp.texi: Likewise. diff --git a/lib/copy-acl.c b/lib/copy-acl.c index d94f8871d..d0817265c 100644 --- a/lib/copy-acl.c +++ b/lib/copy-acl.c @@ -39,13 +39,13 @@ static int qcopy_acl (const char *src_name, int source_desc, const char *dst_name, int dest_desc, mode_t mode) { - int ret; - #if USE_ACL && HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ /* Linux, FreeBSD, MacOS X, IRIX, Tru64 */ acl_t acl; + int ret; + if (HAVE_ACL_GET_FD && source_desc != -1) acl = acl_get_fd (source_desc); else @@ -124,6 +124,7 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name, #elif USE_ACL && defined ACL_NO_TRIVIAL /* Solaris 10 NFSv4 ACLs. */ + int ret; acl_t *aclp = NULL; ret = (source_desc < 0 ? acl_get (src_name, ACL_NO_TRIVIAL, &aclp) @@ -155,8 +156,7 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name, #else - ret = qset_acl (dst_name, dest_desc, mode); - return ret; + return qset_acl (dst_name, dest_desc, mode); #endif } diff --git a/lib/set-mode-acl.c b/lib/set-mode-acl.c index 4d59c0732..f1f7a1ca0 100644 --- a/lib/set-mode-acl.c +++ b/lib/set-mode-acl.c @@ -209,13 +209,13 @@ qset_acl (char const *name, int desc, mode_t mode) } else { - int acl_result = (desc < 0 ? acl_set (name, aclp) : facl_set (desc, aclp)); - int acl_errno = errno; + int ret = (desc < 0 ? acl_set (name, aclp) : facl_set (desc, aclp)); + int saved_errno = errno; acl_free (aclp); - if (acl_result == 0 || acl_errno != ENOSYS) + if (ret == 0 || saved_errno != ENOSYS) { - errno = acl_errno; - return acl_result; + errno = saved_errno; + return ret; } } -- 2.11.0