+2008-06-07 Bruno Haible <bruno@clisp.org>
+
+ * 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 <bruno@clisp.org>
* doc/posix-functions/_setjmp.texi: Explain the use of this function
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
#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)
#else
- ret = qset_acl (dst_name, dest_desc, mode);
- return ret;
+ return qset_acl (dst_name, dest_desc, mode);
#endif
}
}
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;
}
}