summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2008-02-16 13:38:22 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2008-02-16 13:38:22 +0100
commit741400fa666f9754337652c624e95aa6bdfaf98c (patch)
tree3d6d49358106e9a3f4abe9af6016376bac3a928e /tools.c
parent47d6f9d18711c6388e93b23bc8d9ac82b3e7adbf (diff)
downloadvdr-741400fa666f9754337652c624e95aa6bdfaf98c.tar.gz
vdr-741400fa666f9754337652c624e95aa6bdfaf98c.tar.bz2
Fixed handling recordings on other file systems than the video directory
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 43f5bfad..64f4464d 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.142 2008/02/15 14:45:05 kls Exp $
+ * $Id: tools.c 1.143 2008/02/16 13:38:22 kls Exp $
*/
#include "tools.h"
@@ -277,6 +277,21 @@ cString itoa(int n)
return buf;
}
+bool EntriesOnSameFileSystem(const char *File1, const char *File2)
+{
+ struct statfs statFs;
+ if (statfs(File1, &statFs) == 0) {
+ fsid_t fsid1 = statFs.f_fsid;
+ if (statfs(File2, &statFs) == 0)
+ return memcmp(&statFs.f_fsid, &fsid1, sizeof(fsid1)) == 0;
+ else
+ LOG_ERROR_STR(File2);
+ }
+ else
+ LOG_ERROR_STR(File1);
+ return false;
+}
+
int FreeDiskSpaceMB(const char *Directory, int *UsedMB)
{
if (UsedMB)