1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed checking for free disk space, so that it works with NFS mounted drives

This commit is contained in:
Klaus Schmidinger 2001-04-22 10:31:29 +02:00
parent fae6bae6d4
commit 1ef2b1d3a1

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.c 1.32 2001/04/01 14:13:36 kls Exp $ * $Id: tools.c 1.33 2001/04/22 10:31:29 kls Exp $
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
@ -120,7 +120,7 @@ const char *AddDirectory(const char *DirName, const char *FileName)
return buf; return buf;
} }
#define DFCMD "df -m '%s'" #define DFCMD "df -m -P '%s'"
uint FreeDiskSpaceMB(const char *Directory) uint FreeDiskSpaceMB(const char *Directory)
{ {
@ -132,7 +132,7 @@ uint FreeDiskSpaceMB(const char *Directory)
if (p) { if (p) {
char *s; char *s;
while ((s = readline(p)) != NULL) { while ((s = readline(p)) != NULL) {
if (*s == '/') { if (strchr(s, '/')) {
uint available; uint available;
sscanf(s, "%*s %*d %*d %u", &available); sscanf(s, "%*s %*d %*d %u", &available);
Free = available; Free = available;