1
0
Fork 0
forked from len0rd/rockbox

rbutil fixes for OpenBSD (FS#9340 by Brian Waichunas).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19417 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2008-12-13 10:09:13 +00:00
parent 6340a4c9ed
commit e2b69ddffb
3 changed files with 22 additions and 3 deletions

View file

@ -45,6 +45,12 @@
#include <setupapi.h> #include <setupapi.h>
#include <winioctl.h> #include <winioctl.h>
#endif #endif
#if defined(Q_OS_OPENBSD)
#include <sys/param.h>
#include <sys/mount.h>
#endif
#include "detect.h" #include "detect.h"
#include "utils.h" #include "utils.h"
@ -209,7 +215,7 @@ QStringList Autodetection::getMountpoints()
tempList << list.at(i).absolutePath(); tempList << list.at(i).absolutePath();
} }
#elif defined(Q_OS_MACX) #elif defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
int num; int num;
struct statfs *mntinf; struct statfs *mntinf;
@ -269,6 +275,19 @@ QString Autodetection::resolveMountPoint(QString device)
} }
#endif #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) #if defined(Q_OS_WIN32)
QString result; QString result;
unsigned int driveno = device.replace(QRegExp("^.*([0-9]+)"), "\\1").toInt(); unsigned int driveno = device.replace(QRegExp("^.*([0-9]+)"), "\\1").toInt();

View file

@ -41,7 +41,7 @@ void EncExesGui::showCfg(QString name)
{ {
// try to autodetect encoder // 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); QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts);
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts); QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts);

View file

@ -107,7 +107,7 @@ void TTSExes::setCfg(RbSettings* sett)
{ {
QString exepath; QString exepath;
//try autodetect tts //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); QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts);
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts); QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts);