]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
chase: extend comment about CHASE_PARENT
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 9 Apr 2023 23:57:01 +0000 (08:57 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 9 Apr 2023 23:57:01 +0000 (08:57 +0900)
src/basic/chase.h

index 1314777cb4fdaaeecb7c2aca6f2384eaa8368db6..7e9ebe0685de92d528d503def3f7a62642d264cd 100644 (file)
@@ -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);
-