diff options
author | Nathan Scott <nathans@sgi.com> | 2003-02-26 21:15:59 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2003-02-26 21:15:59 +0000 |
commit | 94e247b50e006004dbc1e3345bc4ec7dfbf03b1d (patch) | |
tree | 1e9639aab0475b4328c18f8541bbc0217b83e343 /libacl | |
parent | d01f83eda36a1cc8f9b369d0ff376c74a64771ec (diff) | |
download | acl-94e247b50e006004dbc1e3345bc4ec7dfbf03b1d.tar.gz |
Very minor tidyups to problems I fixed in Andreas last patchset.
Diffstat (limited to 'libacl')
-rw-r--r-- | libacl/perm_copy_fd.c | 7 | ||||
-rw-r--r-- | libacl/perm_copy_file.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/libacl/perm_copy_fd.c b/libacl/perm_copy_fd.c index 9ddb91c..ef96c65 100644 --- a/libacl/perm_copy_fd.c +++ b/libacl/perm_copy_fd.c @@ -146,6 +146,9 @@ perm_copy_fd (const char *src_path, int src_fd, const char *dst_path, int dst_fd, struct error_context *ctx) { +#if defined(HAVE_ACL_GET_FD) && defined(HAVE_ACL_SET_FD) + acl_t acl; +#endif struct stat st; int ret = 0; @@ -157,9 +160,8 @@ perm_copy_fd (const char *src_path, int src_fd, return -1; } #if defined(HAVE_ACL_GET_FD) && defined(HAVE_ACL_SET_FD) - { /* POSIX 1003.1e draft 17 (abandoned) specific version. */ - acl_t acl = acl_get_fd (src_fd); + acl = acl_get_fd (src_fd); if (acl == NULL) { ret = -1; if (errno == ENOSYS || errno == ENOTSUP) @@ -187,7 +189,6 @@ perm_copy_fd (const char *src_path, int src_fd, } (void) acl_free (acl); return ret; - } #else /* POSIX.1 version. */ ret = fchmod (dst_fd, st.st_mode); diff --git a/libacl/perm_copy_file.c b/libacl/perm_copy_file.c index 5586438..aea3bf0 100644 --- a/libacl/perm_copy_file.c +++ b/libacl/perm_copy_file.c @@ -159,6 +159,9 @@ int perm_copy_file (const char *src_path, const char *dst_path, struct error_context *ctx) { +#if defined(HAVE_ACL_GET_FILE) && defined(HAVE_ACL_SET_FILE) + acl_t acl; +#endif struct stat st; int ret = 0; @@ -170,9 +173,8 @@ perm_copy_file (const char *src_path, const char *dst_path, return -1; } #if defined(HAVE_ACL_GET_FILE) && defined(HAVE_ACL_SET_FILE) - { /* POSIX 1003.1e draft 17 (abandoned) specific version. */ - acl_t acl = acl_get_file (src_path, ACL_TYPE_ACCESS); + acl = acl_get_file (src_path, ACL_TYPE_ACCESS); if (acl == NULL) { ret = -1; if (errno == ENOSYS || errno == ENOTSUP) @@ -224,7 +226,6 @@ perm_copy_file (const char *src_path, const char *dst_path, (void) acl_free(acl); } return ret; - } #else /* POSIX.1 version. */ ret = chmod (dst_path, st.st_mode); |