File r922115.diff of Package kdelibs4

------------------------------------------------------------------------
r922115 | mueller | 2009-02-06 15:17:01 +0100 (Fr, 06. Feb 2009) | 2 lines

ignore link counts also with stale lockfiles

------------------------------------------------------------------------
Index: kdecore/io/klockfile_unix.cpp
===================================================================
--- kdecore/io/klockfile_unix.cpp	(Revision 922114)
+++ kdecore/io/klockfile_unix.cpp	(Revision 922115)
@@ -230,13 +230,16 @@ static KLockFile::LockResult deleteStale
       linkCountSupport = testLinkCountSupport(tmpFile);
    }
 
-   if (!linkCountSupport &&
-       (KDE_lstat(lckFile, &st_buf2) == 0) && st_buf == st_buf2)
+   if (!linkCountSupport)
    {
       // Without support for link counts we will have a little race condition
       qWarning("WARNING: deleting stale lockfile %s", lckFile.data());
-      ::unlink(lckFile);
       ::unlink(tmpFile);
+      if (::unlink(lckFile) < 0) {
+          qWarning("WARNING: Problem deleting stale lockfile %s: %s", lckFile.data(),
+                  strerror(errno));
+          return KLockFile::LockFail;
+      }
       return KLockFile::LockOK;
    }
 
openSUSE Build Service is sponsored by