1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed EntriesOnSameFileSystem() to avoid using f_fsid, which may be 0

This commit is contained in:
Klaus Schmidinger 2009-11-06 15:23:52 +01:00
parent b2715518f8
commit ff858b78a3
3 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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).

12
tools.c
View File

@ -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);
}