Skip to content

Commit 4ec19c7

Browse files
authored
Address review
1 parent 052c125 commit 4ec19c7

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

Utilities/File.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,21 +1225,20 @@ bool fs::is_optical_raw_device(const std::string& path)
12251225

12261226
return false;
12271227
#else
1228-
// Skip a useless check if the path cannot point to a device node (device nodes always live in "/dev")
1229-
if (!path.starts_with("/dev/"))
1230-
{
1231-
return false;
1232-
}
1233-
1234-
#if defined(__APPLE__)
1228+
#ifdef __APPLE__
12351229
// On Mac OS X optical disks will only ever be mounted under /dev/disk(whatever), similar for raw devices,
12361230
// so reject anything not containing the disk string.
12371231
if (!path.starts_with("/dev/disk") && !path.starts_with("/dev/rdisk"))
12381232
{
12391233
return false;
12401234
}
1235+
#else
1236+
// Skip a useless check if the path cannot point to a device node (device nodes always live in "/dev")
1237+
if (!path.starts_with("/dev/"))
1238+
{
1239+
return false;
1240+
}
12411241
#endif
1242-
12431242
struct ::stat file_info;
12441243

12451244
if (::stat(path.c_str(), &file_info) != 0)

0 commit comments

Comments
 (0)