* lib/acl.h (xset_acl): New declaration.
(set_acl): Mark deprecated.
(xcopy_acl): New declaration.
(copy_acl): Mark deprecated.
* lib/set-acl.c (xset_acl): Renamed from set_acl.
(set_acl): New function.
* lib/copy-acl.c (xcopy_acl): Renamed from copy_acl.
(copy_acl): New function.
* tests/test-set-mode-acl.c (main): Test xset_acl instead of set_acl.
* tests/test-copy-acl.c (main): Test xcopy_acl instead of copy_acl.
+2024-08-24 Bruno Haible <bruno@clisp.org>
+
+ acl: First step towards more consistent function names.
+ * lib/acl.h (xset_acl): New declaration.
+ (set_acl): Mark deprecated.
+ (xcopy_acl): New declaration.
+ (copy_acl): Mark deprecated.
+ * lib/set-acl.c (xset_acl): Renamed from set_acl.
+ (set_acl): New function.
+ * lib/copy-acl.c (xcopy_acl): Renamed from copy_acl.
+ (copy_acl): New function.
+ * tests/test-set-mode-acl.c (main): Test xset_acl instead of set_acl.
+ * tests/test-copy-acl.c (main): Test xcopy_acl instead of copy_acl.
+
2024-08-24 Paul Eggert <eggert@cs.ucla.edu>
diffseq: port to clang 18.1.6 in ‘patch’
#ifndef _GL_ACL_H
#define _GL_ACL_H 1
-/* This file uses _GL_ATTRIBUTE_CONST. */
+/* This file uses _GL_ATTRIBUTE_CONST, _GL_ATTRIBUTE_DEPRECATED. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
bool acl_errno_valid (int) _GL_ATTRIBUTE_CONST;
int file_has_acl (char const *, struct stat const *);
+
int qset_acl (char const *, int, mode_t);
-int set_acl (char const *, int, mode_t);
+int xset_acl (char const *, int, mode_t);
+/* Old name of xset_acl. */
+_GL_ATTRIBUTE_DEPRECATED int set_acl (char const *, int, mode_t);
+
int qcopy_acl (char const *, int, char const *, int, mode_t);
-int copy_acl (char const *, int, char const *, int, mode_t);
+int xcopy_acl (char const *, int, char const *, int, mode_t);
+/* Old name of xcopy_acl. */
+_GL_ATTRIBUTE_DEPRECATED int copy_acl (char const *, int, char const *, int,
+ mode_t);
+
int chmod_or_fchmod (char const *, int, mode_t);
negative error code. */
int
-copy_acl (const char *src_name, int source_desc, const char *dst_name,
- int dest_desc, mode_t mode)
+xcopy_acl (const char *src_name, int source_desc, const char *dst_name,
+ int dest_desc, mode_t mode)
{
int ret = qcopy_acl (src_name, source_desc, dst_name, dest_desc, mode);
switch (ret)
}
return ret;
}
+
+int
+copy_acl (const char *src_name, int source_desc, const char *dst_name,
+ int dest_desc, mode_t mode)
+{
+ return xcopy_acl (src_name, source_desc, dst_name, dest_desc, mode);
+}
return -1. */
int
-set_acl (char const *name, int desc, mode_t mode)
+xset_acl (char const *name, int desc, mode_t mode)
{
int ret = qset_acl (name, desc, mode);
if (ret != 0)
error (0, errno, _("setting permissions for %s"), quote (name));
return ret;
}
+
+int
+set_acl (char const *name, int desc, mode_t mode)
+{
+ return xset_acl (name, desc, mode);
+}
}
#if USE_ACL
- if (copy_acl (file1, fd1, file2, fd2, mode))
+ if (xcopy_acl (file1, fd1, file2, fd2, mode))
exit (EXIT_FAILURE);
#else
chmod (file2, mode);
file = argv[1];
mode = strtol (argv[2], NULL, 8);
- set_acl (file, -1, mode);
+ xset_acl (file, -1, mode);
return test_exit_status;
}