diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-11-06 15:23:52 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-11-06 15:23:52 +0100 |
commit | ff858b78a3297fe9197eabc2d950d2c3afa39c6f (patch) | |
tree | 93c6edf40aafb9c1743bbfe5e51a3415117f36aa | |
parent | b2715518f8182df0b63933d8bd9d058032b4a8e8 (diff) | |
download | vdr-ff858b78a3297fe9197eabc2d950d2c3afa39c6f.tar.gz vdr-ff858b78a3297fe9197eabc2d950d2c3afa39c6f.tar.bz2 |
Fixed EntriesOnSameFileSystem() to avoid using f_fsid, which may be 0
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | tools.c | 12 |
3 files changed, 10 insertions, 7 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 0c34d0f3..9758c48e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2271,6 +2271,7 @@ Frank Schmirler <vdr@schmirler.de> for fixing handling the 'pointer field' in generating and parsing PAT/PMT for suggesting to use an "instance id" instead of the "resume id" to distinguish recordings of the same broadcast made by different instances of VDR + for fixing EntriesOnSameFileSystem() to avoid using f_fsid, which may be 0 Jörn Reder <joern@zyn.de> for reporting that a recording may unnecessarily block a device with a CAM, while @@ -6157,7 +6157,7 @@ Video Disk Recorder Revision History Reinhard Nissl). - Implemented full handling of subtitling descriptors (thanks to Mikko Tuumanen). -2009-11-01: Version 1.7.10 +2009-11-06: Version 1.7.10 - Updated the Italian OSD texts (thanks to Diego Pierotto). - Fixed wrong bracketing in cChannel::SubtitlingType() etc. @@ -6177,3 +6177,5 @@ Video Disk Recorder Revision History - Fixed writing the PCR pid into the PMT in cPatPmtGenerator::GeneratePmt() (reported by Rene van den Braken). - Added Slovakian language texts (thanks to Milan Hrala). +- Fixed EntriesOnSameFileSystem() to avoid using f_fsid, which may be 0 (thanks + to Frank Schmirler). @@ -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); } |