diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-16 13:38:22 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-16 13:38:22 +0100 |
commit | 741400fa666f9754337652c624e95aa6bdfaf98c (patch) | |
tree | 3d6d49358106e9a3f4abe9af6016376bac3a928e /tools.c | |
parent | 47d6f9d18711c6388e93b23bc8d9ac82b3e7adbf (diff) | |
download | vdr-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.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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) |