summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/autodetection.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-12-13 10:09:13 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-12-13 10:09:13 +0000
commite2b69ddffb9e731ef6c1bb1b704fe9038e999817 (patch)
treedc285de5d6de757c3a63a006b0f7c098b90ffc06 /rbutil/rbutilqt/base/autodetection.cpp
parent6340a4c9ed80e1a04e688be7578161583d886892 (diff)
downloadrockbox-e2b69ddffb9e731ef6c1bb1b704fe9038e999817.tar.gz
rockbox-e2b69ddffb9e731ef6c1bb1b704fe9038e999817.tar.bz2
rockbox-e2b69ddffb9e731ef6c1bb1b704fe9038e999817.zip
rbutil fixes for OpenBSD (FS#9340 by Brian Waichunas).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19417 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/autodetection.cpp')
-rw-r--r--rbutil/rbutilqt/base/autodetection.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp
index 2a82bf319f..54c047792a 100644
--- a/rbutil/rbutilqt/base/autodetection.cpp
+++ b/rbutil/rbutilqt/base/autodetection.cpp
@@ -45,6 +45,12 @@
#include <setupapi.h>
#include <winioctl.h>
#endif
+
+#if defined(Q_OS_OPENBSD)
+#include <sys/param.h>
+#include <sys/mount.h>
+#endif
+
#include "detect.h"
#include "utils.h"
@@ -209,7 +215,7 @@ QStringList Autodetection::getMountpoints()
tempList << list.at(i).absolutePath();
}
-#elif defined(Q_OS_MACX)
+#elif defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
int num;
struct statfs *mntinf;
@@ -269,6 +275,19 @@ QString Autodetection::resolveMountPoint(QString device)
}
#endif
+#if defined(Q_OS_OPENBSD)
+ int num;
+ struct statfs *mntinf;
+
+ num = getmntinfo(&mntinf, MNT_WAIT);
+ while(num--) {
+ if(QString(mntinf->f_mntfromname).startsWith(device)
+ && QString(mntinf->f_fstypename).contains("msdos", Qt::CaseInsensitive))
+ return QString(mntinf->f_mntonname);
+ mntinf++;
+ }
+#endif
+
#if defined(Q_OS_WIN32)
QString result;
unsigned int driveno = device.replace(QRegExp("^.*([0-9]+)"), "\\1").toInt();