diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2007-09-02 09:36:28 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2007-09-02 09:36:28 +0000 |
commit | c00652b0a222b6d5a25437b972d34d72619b00a8 (patch) | |
tree | f1f109d6452689c856fbcfd0fb41aba4105000cd | |
parent | 84f8f3dd1b4d9f4386f88b83860a200e259dfb2e (diff) |
use the getmntend api here too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14574 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/rbutilqt/autodetection.cpp | 20 |
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 |