From 4fb28dfc10106c4095ca3b1155d4da9a04467fd1 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 26 Aug 2020 11:17:10 -0400 Subject: [PATCH] Cleanup: autoconf 'dirfd' detection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Remove the unused AM conditionnal and use the 'HAVE_' prefix for the define like the other detected features. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau Change-Id: I9a001051a14e2360e7f66fd4f627f97b11563c4f --- configure.ac | 4 +--- src/common/compat/directory-handle.c | 6 +++--- src/common/compat/directory-handle.h | 2 +- src/common/fd-tracker/utils.c | 6 +++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 1186d2ffd..36f00de2a 100644 --- a/configure.ac +++ b/configure.ac @@ -632,10 +632,8 @@ AS_IF([test "x$ac_cv_func_dirfd" = "xyes"], ) AX_CONFIG_FEATURE( [dirfd], [Use directory file descriptors], - [COMPAT_DIRFD], [This platform supports directory file descriptors.], - [enable_dirfd="yes"], [enable_dirfd="no"] + [HAVE_DIRFD], [This platform supports directory file descriptors.] ) -AM_CONDITIONAL([COMPAT_DIRFD], [ test "$enable_dirfd" = "yes" ]) AM_CONDITIONAL([TEST_JAVA_JUL_AGENT], [test "x$test_java_agent_jul" = "xyes"]) AM_CONDITIONAL([TEST_JAVA_LOG4J_AGENT], [test "x$test_java_agent_log4j" = "xyes"]) diff --git a/src/common/compat/directory-handle.c b/src/common/compat/directory-handle.c index aea4be5fe..356376ac0 100644 --- a/src/common/compat/directory-handle.c +++ b/src/common/compat/directory-handle.c @@ -78,7 +78,7 @@ void lttng_directory_handle_invalidate(struct lttng_directory_handle *handle); static void lttng_directory_handle_release(struct urcu_ref *ref); -#ifdef COMPAT_DIRFD +#ifdef HAVE_DIRFD /* * Special inode number reserved to represent the "current working directory". @@ -378,7 +378,7 @@ int _run_as_rmdir_recursive( return run_as_rmdirat_recursive(handle->dirfd, name, uid, gid, flags); } -#else /* COMPAT_DIRFD */ +#else /* HAVE_DIRFD */ static int get_full_path(const struct lttng_directory_handle *handle, @@ -891,7 +891,7 @@ end: return ret; } -#endif /* COMPAT_DIRFD */ +#endif /* HAVE_DIRFD */ /* Common implementation. */ diff --git a/src/common/compat/directory-handle.h b/src/common/compat/directory-handle.h index 574a09d74..24f1e6f68 100644 --- a/src/common/compat/directory-handle.h +++ b/src/common/compat/directory-handle.h @@ -25,7 +25,7 @@ enum lttng_directory_handle_rmdir_recursive_flags { * This wrapper provides a handle that is either a copy of a directory's path * or a directory file descriptors, depending on the platform's capabilities. */ -#ifdef COMPAT_DIRFD +#ifdef HAVE_DIRFD struct lttng_directory_handle; diff --git a/src/common/fd-tracker/utils.c b/src/common/fd-tracker/utils.c index fe2cdcc4e..85d28b294 100644 --- a/src/common/fd-tracker/utils.c +++ b/src/common/fd-tracker/utils.c @@ -101,7 +101,7 @@ int open_directory_handle(void *_args, int *out_fds) if (!lttng_directory_handle_uses_fd(new_handle)) { ret = ENOTSUP; } else { -#ifdef COMPAT_DIRFD +#ifdef HAVE_DIRFD *out_fds = new_handle->dirfd; #else abort(); @@ -112,7 +112,7 @@ end: return ret; } -#ifdef COMPAT_DIRFD +#ifdef HAVE_DIRFD static int fd_close(void *unused, int *in_fds) { @@ -182,7 +182,7 @@ struct lttng_directory_handle *fd_tracker_create_directory_handle_from_handle( } new_handle = open_args.ret_handle; -#ifdef COMPAT_DIRFD +#ifdef HAVE_DIRFD new_handle->destroy_cb = directory_handle_destroy; new_handle->destroy_cb_data = tracker; #endif -- 2.34.1