Skip to content

Commit

Permalink
changed: don't use -x parameter with 'df'. Commit for cptspiff.
Browse files Browse the repository at this point in the history
we instead filter the list ourself. the busybox df does not support -x
  • Loading branch information
theuni committed Jan 20, 2012
1 parent 0dffbad commit e20f3f0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions xbmc/linux/PosixMountProvider.cpp
Expand Up @@ -101,14 +101,26 @@ std::vector<CStdString> CPosixMountProvider::GetDiskUsage()
#elif defined(__FreeBSD__)
FILE* pipe = popen("df -h -t ufs,cd9660,hfs,udf,zfs", "r");
#else
FILE* pipe = popen("df -hx tmpfs", "r");
FILE* pipe = popen("df -h", "r");
#endif

static const char* excludes[] = {"rootfs","devtmpfs","tmpfs","none","/dev/loop", "udev", NULL};

if (pipe)
{
while (fgets(line, sizeof(line) - 1, pipe))
{
result.push_back(line);
bool ok=true;
for (int i=0;excludes[i];++i)
{
if (strstr(line,excludes[i]))
{
ok=false;
break;
}
}
if (ok)
result.push_back(line);
}
pclose(pipe);
}
Expand Down

0 comments on commit e20f3f0

Please sign in to comment.