diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-06-18 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-06-18 18:00:00 +0200 |
commit | 90bc2f18e3fb72bba792226dfd2a6e245464d2f5 (patch) | |
tree | 91c7685580e639523ffd3f79c4993b6b48451e91 /tools.c | |
parent | 2bb325135433521694b0a387a60225d7727a980e (diff) | |
download | vdr-patch-lnbsharing-90bc2f18e3fb72bba792226dfd2a6e245464d2f5.tar.gz vdr-patch-lnbsharing-90bc2f18e3fb72bba792226dfd2a6e245464d2f5.tar.bz2 |
Version 1.4.1-1vdr-1.4.1-1
- Added "-fPIC" to the compiler options in Make.config.template when compiling
plugins (thanks to Udo Richter). If you use your own Make.config file, you may
want to add these lines there, too.
- Added some comment to cDevice::GetDevice() to explain how the individual
conditions are put together to make a decision on which device to use.
- Updated 'S13E' in 'sources.conf' (thanks to Antti Hartikainen).
- Now making sure VPS timers don't get stuck with outdated events, and that the
actual device isn't used for updating a VPS timer's event as long as other
free devices are available.
- Modified rcu.c to better handle RC5 codes.
- Added a missing variable initialization in cRingBufferLinear::cRingBufferLinear()
(thanks to Prakash Punnoor).
- Fixed handling relative link targets in the ReadLink() function (reported by
Patrick Cernko).
- Now making sure a VPS timer has a schedule in case the epg.data file didn't
contain one when VDR was started.
Diffstat (limited to 'tools.c')
-rw-r--r-- | tools.c | 22 |
1 files changed, 8 insertions, 14 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.118 2006/05/26 10:10:31 kls Exp $ + * $Id: tools.c 1.119 2006/06/17 09:45:32 kls Exp $ */ #include "tools.h" @@ -480,22 +480,16 @@ int DirSizeMB(const char *DirName) char *ReadLink(const char *FileName) { - char RealName[PATH_MAX]; - const char *TargetName = NULL; - int n = readlink(FileName, RealName, sizeof(RealName) - 1); - if (n < 0) { - if (errno == ENOENT || errno == EINVAL) // file doesn't exist or is not a symlink - TargetName = FileName; + if (!FileName) + return NULL; + char *TargetName = canonicalize_file_name(FileName); + if (!TargetName) { + if (errno == ENOENT) // file doesn't exist + TargetName = strdup(FileName); else // some other error occurred LOG_ERROR_STR(FileName); } - else if (n < int(sizeof(RealName))) { // got it! - RealName[n] = 0; - TargetName = RealName; - } - else - esyslog("ERROR: symlink's target name too long: %s", FileName); - return TargetName ? strdup(TargetName) : NULL; + return TargetName; } bool SpinUpDisk(const char *FileName) |