summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
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)