Skip to content

Commit 9c74515

Browse files
committed
rollback is_mount_point() changes
1 parent 3ea6a64 commit 9c74515

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

Utilities/File.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,9 @@ static bool is_optical_device_node(const struct ::stat& file_info)
227227
// Check whether the path is the root of a mounted filesystem (e.g. the mount point of a disc): "st_dev" changes when crossing a mount point
228228
[[maybe_unused]] static bool is_mount_point(const std::string& path, const struct ::stat& file_info)
229229
{
230-
// A file is never a mount point: discard it without any syscall (the "stat()" below would fail with ENOTDIR anyway)
231-
if (!S_ISDIR(file_info.st_mode))
232-
{
233-
return false;
234-
}
235-
236230
struct ::stat parent_info;
237231

232+
// NOTE: it also fails (ENOTDIR) if the path is a file, which is never a mount point
238233
if (::stat((path + "/..").c_str(), &parent_info) != 0)
239234
{
240235
return false;

0 commit comments

Comments
 (0)