summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2007-09-02 09:36:28 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2007-09-02 09:36:28 +0000
commitc00652b0a222b6d5a25437b972d34d72619b00a8 (patch)
treef1f109d6452689c856fbcfd0fb41aba4105000cd /rbutil
parent84f8f3dd1b4d9f4386f88b83860a200e259dfb2e (diff)
downloadrockbox-c00652b0a222b6d5a25437b972d34d72619b00a8.tar.gz
rockbox-c00652b0a222b6d5a25437b972d34d72619b00a8.zip
use the getmntend api here too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14574 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/autodetection.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/autodetection.cpp b/rbutil/rbutilqt/autodetection.cpp
index a359b91afd..8f478835be 100644
--- a/rbutil/rbutilqt/autodetection.cpp
+++ b/rbutil/rbutilqt/autodetection.cpp
@@ -117,17 +117,15 @@ QStringList Autodetection::getMountpoints()
#elif defined(Q_OS_LINUX)
QStringList tempList;
- FILE *fp = fopen( "/proc/mounts", "r" );
- if( !fp ) return tempList;
- char *dev, *dir;
- while( fscanf( fp, "%as %as %*s %*s %*s %*s", &dev, &dir ) != EOF )
- {
- tempList << dir;
- free( dev );
- free( dir );
- }
- fclose( fp );
-
+ FILE *mn = setmntent("/etc/mtab", "r");
+ if(!mn)
+ return QStringList("");
+
+ struct mntent *ent;
+ while((ent = getmntent(mn)))
+ tempList << QString(ent->mnt_dir);
+ endmntent(mn);
+
return tempList;
#else
#error Unknown Plattform