mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
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:
parent
6340a4c9ed
commit
e2b69ddffb
3 changed files with 22 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue