summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-11-06 15:23:52 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2009-11-06 15:23:52 +0100
commitff858b78a3297fe9197eabc2d950d2c3afa39c6f (patch)
tree93c6edf40aafb9c1743bbfe5e51a3415117f36aa /tools.c
parentb2715518f8182df0b63933d8bd9d058032b4a8e8 (diff)
downloadvdr-ff858b78a3297fe9197eabc2d950d2c3afa39c6f.tar.gz
vdr-ff858b78a3297fe9197eabc2d950d2c3afa39c6f.tar.bz2
Fixed EntriesOnSameFileSystem() to avoid using f_fsid, which may be 0
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools.c b/tools.c
index 9ef61f57..fae87635 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 2.3 2009/05/31 11:43:24 kls Exp $
+ * $Id: tools.c 2.4 2009/11/06 15:21:17 kls Exp $
*/
#include "tools.h"
@@ -279,11 +279,11 @@ cString itoa(int n)
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;
+ struct stat st;
+ if (stat(File1, &st) == 0) {
+ dev_t dev1 = st.st_dev;
+ if (stat(File2, &st) == 0)
+ return st.st_dev == dev1;
else
LOG_ERROR_STR(File2);
}