There's no reason to eat up ENOENT, it should be OK to simply report the
error back.
* mount point), otherwise fallback to the
* traditional stat() logic */
nosupp = true;
* mount point), otherwise fallback to the
* traditional stat() logic */
nosupp = true;
- else if (errno == ENOENT)
- return 0;
fallback:
r = fstatat(fd, "", &a, AT_EMPTY_PATH);
fallback:
r = fstatat(fd, "", &a, AT_EMPTY_PATH);
- if (r < 0) {
- if (errno == ENOENT)
- return 0;
-
r = fstatat(fd, "..", &b, 0);
if (r < 0)
r = fstatat(fd, "..", &b, 0);
if (r < 0)
int path_is_mount_point(const char *t, bool allow_symlink) {
_cleanup_close_ int fd = -1;
int path_is_mount_point(const char *t, bool allow_symlink) {
_cleanup_close_ int fd = -1;
assert(t);
if (path_equal(t, "/"))
return 1;
fd = openat(AT_FDCWD, t, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|(allow_symlink ? 0 : O_PATH));
assert(t);
if (path_equal(t, "/"))
return 1;
fd = openat(AT_FDCWD, t, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|(allow_symlink ? 0 : O_PATH));
- if (fd < 0) {
- if (errno == ENOENT)
- return 0;
-
return fd_is_mount_point(fd);
}
return fd_is_mount_point(fd);
}