chase: drop one redundant call of fstat()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 9 Apr 2023 23:43:28 +0000 (08:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 9 Apr 2023 23:43:31 +0000 (08:43 +0900)
Now, 'st' is always synced with 'fd'. Hence, we can use
stat_verify_directory().

src/basic/chase.c

index 699ca6985f6b230132fe134a42f77fd9469e04b3..dcc2339944f77988d6871144d0f31111166f961d 100644 (file)
@@ -398,7 +398,7 @@ int chaseat(int dir_fd, const char *path, ChaseFlags flags, char **ret_path, int
         }
 
         if (flags & CHASE_PARENT) {
-                r = fd_verify_directory(fd);
+                r = stat_verify_directory(&st);
                 if (r < 0)
                         return r;
         }