aboutsummaryrefslogtreecommitdiff
path: root/drivers/unix/dir_access_unix.cpp
diff options
context:
space:
mode:
authorHein-Pieter van Braam2017-09-14 21:43:17 +0200
committerHein-Pieter van Braam2017-09-14 23:04:30 +0200
commit65af96eab0708c02c5a72bb7d2a18444cc728046 (patch)
treeb2a3dc820638928255bf18fbf38c527f60ce2a8c /drivers/unix/dir_access_unix.cpp
parent5636ac526e1d9b211700ec2386c2a01c2419d1f7 (diff)
downloadgodot-65af96eab0708c02c5a72bb7d2a18444cc728046.tar.gz
godot-65af96eab0708c02c5a72bb7d2a18444cc728046.tar.zst
godot-65af96eab0708c02c5a72bb7d2a18444cc728046.zip
Diffstat (limited to 'drivers/unix/dir_access_unix.cpp')
-rw-r--r--drivers/unix/dir_access_unix.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index 45ea654ba..e7054e11a 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -183,17 +183,18 @@ void DirAccessUnix::list_dir_end() {
_cisdir = false;
}
-#ifdef HAVE_MNTENT
+#if defined(HAVE_MNTENT) && defined(X11_ENABLED)
static bool _filter_drive(struct mntent *mnt) {
// Ignore devices that don't point to /dev
if (strncmp(mnt->mnt_fsname, "/dev", 4) != 0) {
return false;
}
- // Accept devices mounted at /media, /mnt or /home
+ // Accept devices mounted at common locations
if (strncmp(mnt->mnt_dir, "/media", 6) == 0 ||
strncmp(mnt->mnt_dir, "/mnt", 4) == 0 ||
- strncmp(mnt->mnt_dir, "/home", 5) == 0) {
+ strncmp(mnt->mnt_dir, "/home", 5) == 0 ||
+ strncmp(mnt->mnt_dir, "/run/media", 10) == 0) {
return true;
}
@@ -204,7 +205,7 @@ static bool _filter_drive(struct mntent *mnt) {
static void _get_drives(List<String> *list) {
-#ifdef HAVE_MNTENT
+#if defined(HAVE_MNTENT) && defined(X11_ENABLED)
// Check /etc/mtab for the list of mounted partitions
FILE *mtab = setmntent("/etc/mtab", "r");
if (mtab) {