diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-02 22:16:33 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-02 22:16:33 +0100 |
commit | 802635f2e07084f058cdde3057ba31a20345e94d (patch) | |
tree | 0b01668e6296abc9344225eee8ed3a9c4cdb5b1d | |
parent | 0babd10cdf9a589209895b5c8a2f5d7650db5cfc (diff) | |
download | abrt-802635f2e07084f058cdde3057ba31a20345e94d.tar.gz abrt-802635f2e07084f058cdde3057ba31a20345e94d.tar.xz abrt-802635f2e07084f058cdde3057ba31a20345e94d.zip |
avoid deadlocks (zprikryl)
-rw-r--r-- | lib/Utils/DebugDump.cpp | 8 |
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; } } |