summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-03-02 22:16:33 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2009-03-02 22:16:33 +0100
commit802635f2e07084f058cdde3057ba31a20345e94d (patch)
tree0b01668e6296abc9344225eee8ed3a9c4cdb5b1d
parent0babd10cdf9a589209895b5c8a2f5d7650db5cfc (diff)
downloadabrt-802635f2e07084f058cdde3057ba31a20345e94d.tar.gz
abrt-802635f2e07084f058cdde3057ba31a20345e94d.tar.xz
abrt-802635f2e07084f058cdde3057ba31a20345e94d.zip
avoid deadlocks (zprikryl)
-rw-r--r--lib/Utils/DebugDump.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index fcd3b728..315b564a 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -92,12 +92,20 @@ bool CDebugDump::GetAndSetLock(const std::string& pLockFile, const std::string&
else
{
std::string line;
+ std::stringstream ss;
getline(fIn, line);
if (line == pPID)
{
m_bUnlock = false;
return true;
}
+ ss << "/proc/" << line << "/";
+ if (!ExistFileDir(ss.str()))
+ {
+ remove(pLockFile.c_str());
+ Delete();
+ throw std::string("CDebugDump::GetAndSetLock(): dead lock found");
+ }
return false;
}
}