diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-11-24 16:08:06 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-11-24 16:08:06 +0100 |
commit | b4d1358c50fb095eb7a2daf494780ce193ffb453 (patch) | |
tree | 579ab101c24f2ee53e14f9ce3ce5f09efdf6152b | |
parent | 9ee568e1991f1c2eaae885593db5c2f1d2c8f754 (diff) | |
download | vdr-b4d1358c50fb095eb7a2daf494780ce193ffb453.tar.gz vdr-b4d1358c50fb095eb7a2daf494780ce193ffb453.tar.bz2 |
Improved deleting stale lock files1.1.17
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | tools.c | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 83af710c..d8ecbf35 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -435,6 +435,7 @@ Oliver Endriss <o.endriss@gmx.de> for reporting a bug in the EPG scanner, which broke 'Transfer Mode' as soon as it kicked in for providing examples for 'diseqc.conf' + for improving deleting stale lock files Reinhard Walter Buchner <rw.buchner@freenet.de> for adding some satellites to 'sources.conf' @@ -1808,3 +1808,7 @@ Video Disk Recorder Revision History - Made some channels unique in 'channels.conf.terr' using the new RID. - Extended the '-l' option to allow logging to LOG_LOCALn (n=0..7) by writing, for instance, '-l 3.7' (suggested by Jürgen Schmidt). +- Now deleting stale lock files if they have a time stamp that is outside the window + 'now +/- LOCKFILESTALETIME'. This improves things in cases where the system time + makes far jumps, so that a lock file might end up with a time stamp that lies + in the distant future (thanks to Oliver Endriss). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 1.74 2002/11/24 15:47:02 kls Exp $ + * $Id: tools.c 1.75 2002/11/24 16:04:57 kls Exp $ */ #include "tools.h" @@ -722,7 +722,7 @@ bool cLockFile::Lock(int WaitSeconds) if (errno == EEXIST) { struct stat fs; if (stat(fileName, &fs) == 0) { - if (time(NULL) - fs.st_mtime > LOCKFILESTALETIME) { + if (abs(time(NULL)) - fs.st_mtime > LOCKFILESTALETIME) { esyslog("ERROR: removing stale lock file '%s'", fileName); if (remove(fileName) < 0) { LOG_ERROR_STR(fileName); |