summaryrefslogtreecommitdiffstats
path: root/rbutil
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
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')
-rw-r--r--rbutil/rbutilqt/base/autodetection.cpp21
-rw-r--r--rbutil/rbutilqt/encodersgui.cpp2
-rw-r--r--rbutil/rbutilqt/tts.cpp2
3 files changed, 22 insertions, 3 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();
diff --git a/rbutil/rbutilqt/encodersgui.cpp b/rbutil/rbutilqt/encodersgui.cpp
index 4d009252b4..82bd8650fb 100644
--- a/rbutil/rbutilqt/encodersgui.cpp
+++ b/rbutil/rbutilqt/encodersgui.cpp
@@ -41,7 +41,7 @@ void EncExesGui::showCfg(QString name)
{
// try to autodetect encoder
-#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
+#if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts);
#elif defined(Q_OS_WIN)
QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts);
diff --git a/rbutil/rbutilqt/tts.cpp b/rbutil/rbutilqt/tts.cpp
index 76eacd54ca..252608f53e 100644
--- a/rbutil/rbutilqt/tts.cpp
+++ b/rbutil/rbutilqt/tts.cpp
@@ -107,7 +107,7 @@ void TTSExes::setCfg(RbSettings* sett)
{
QString exepath;
//try autodetect tts
-#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
+#if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts);
#elif defined(Q_OS_WIN)
QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts);