From d9b820de67813a5e2b92e4249e5a25cf8d884720 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 26 Feb 2018 13:52:27 -0500 Subject: [PATCH] Move a few constants out of the libadacl.h header to where they are used. --- src/apply-default-acl.c | 2 ++ src/libadacl.c | 9 +++++++++ src/libadacl.h | 12 ++---------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/apply-default-acl.c b/src/apply-default-acl.c index e5b989a..7a67052 100644 --- a/src/apply-default-acl.c +++ b/src/apply-default-acl.c @@ -20,6 +20,8 @@ #include "libadacl.h" +#define NFTW_ERROR -1 + /** * @brief Determine whether or not the given path is accessible. diff --git a/src/libadacl.c b/src/libadacl.c index b25a43b..8e36230 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -26,6 +26,15 @@ #include "libadacl.h" +/* Even though most other library functions reliably return -1 for + * error, it feels a little wrong to re-use the ACL_ERROR constant. + */ +#define CLOSE_ERROR -1 +#define OPEN_ERROR -1 +#define SNPRINTF_ERROR -1 +#define STAT_ERROR -1 + + /** * @brief The recursive portion of the @c safe_open function, used to * open a file descriptor in a symlink-safe way when combined with diff --git a/src/libadacl.h b/src/libadacl.h index a846c88..c70487a 100644 --- a/src/libadacl.h +++ b/src/libadacl.h @@ -6,20 +6,12 @@ */ /* Most of the libacl functions return 1 for success, 0 for failure, - and -1 on error */ + * and -1 on error. We follow suit. +*/ #define ACL_ERROR -1 #define ACL_FAILURE 0 #define ACL_SUCCESS 1 -/* Even though most other library functions reliably return -1 for - * error, it feels a little wrong to re-use the ACL_ERROR constant. - */ -#define CLOSE_ERROR -1 -#define NFTW_ERROR -1 -#define OPEN_ERROR -1 -#define SNPRINTF_ERROR -1 -#define STAT_ERROR -1 - int apply_default_acl_ex(const char* path, const struct stat* sp, bool no_exec_mask); -- 2.44.2