From a0d3e0ec797974e7aaab6e56a89de44fc382d52d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 10 Apr 2023 08:57:01 +0900 Subject: [PATCH] chase: extend comment about CHASE_PARENT --- src/basic/chase.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/basic/chase.h b/src/basic/chase.h index 1314777cb4f..7e9ebe0685d 100644 --- a/src/basic/chase.h +++ b/src/basic/chase.h @@ -22,7 +22,9 @@ typedef enum ChaseFlags { CHASE_PROHIBIT_SYMLINKS = 1 << 9, /* Refuse all symlinks */ CHASE_PARENT = 1 << 10, /* Chase the parent directory of the given path. Note that the * full path is still stored in ret_path and only the returned - * file descriptor will point to the parent directory. */ + * file descriptor will point to the parent directory. Note that + * the result path is the root or '.', then the file descriptor + * also points to the result path even if this flag is set. */ CHASE_MKDIR_0755 = 1 << 11, /* Create any missing parent directories in the given path. */ CHASE_EXTRACT_FILENAME = 1 << 12, /* Only return the last component of the resolved path */ } ChaseFlags; @@ -51,4 +53,3 @@ int chase_and_accessat(int dir_fd, const char *path, ChaseFlags chase_flags, int int chase_and_fopenat_unlocked(int dir_fd, const char *path, ChaseFlags chase_flags, const char *open_flags, char **ret_path, FILE **ret_file); int chase_and_unlinkat(int dir_fd, const char *path, ChaseFlags chase_flags, int unlink_flags, char **ret_path); int chase_and_open_parent_at(int dir_fd, const char *path, ChaseFlags chase_flags, char **ret_filename); - -- 2.47.3