From: Yu Watanabe Date: Sun, 9 Apr 2023 23:57:01 +0000 (+0900) Subject: chase: extend comment about CHASE_PARENT X-Git-Tag: v254-rc1~776^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0d3e0ec797974e7aaab6e56a89de44fc382d52d;p=thirdparty%2Fsystemd.git chase: extend comment about CHASE_PARENT --- 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); -