diff options
author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-29 13:16:37 +0200 |
---|---|---|
committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-29 13:16:37 +0200 |
commit | 8442eaf5a6ddde159c4cda70ddca3efe0976ea50 (patch) | |
tree | 95a1bd2861782d77d5ad38ae106de9e63392a95b /lib/Utils/DebugDump.cpp | |
parent | 1e752b178131fa0268151219deb35e09c40e29bc (diff) | |
download | abrt-8442eaf5a6ddde159c4cda70ddca3efe0976ea50.tar.gz abrt-8442eaf5a6ddde159c4cda70ddca3efe0976ea50.tar.xz abrt-8442eaf5a6ddde159c4cda70ddca3efe0976ea50.zip |
weak reference to commlayerinner
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
-rw-r--r-- | lib/Utils/DebugDump.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index 46effa9..f4d4cc9 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -37,6 +37,14 @@ #include <magic.h> #include <string.h> +#include "CommLayerInner.h" +#pragma weak comm_layer_inner_debug +#define comm_layer_inner_debug(msg) ({\ + if (comm_layer_inner_debug)\ + {\ + comm_layer_inner_debug(msg);\ + }}) + #define PID_STR_MAX 16 CDebugDump::CDebugDump() : @@ -103,16 +111,17 @@ bool CDebugDump::GetAndSetLock(const std::string& pLockFile, const std::string& { close(fd); m_bUnlock = false; + comm_layer_inner_debug("Lock file '"+pLockFile+"' is locked by same process"); return true; } if (lockf(fd, F_TEST, 0) == 0) { - std::cerr << lockf(fd, F_TEST, 0) << std::endl; close(fd); remove(pLockFile.c_str()); Delete(); throw CABRTException(EXCEP_ERROR, "CDebugDump::GetAndSetLock(): dead lock found"); } + comm_layer_inner_debug("Lock file '"+pLockFile+"' is locked by another process"); close(fd); return false; } @@ -135,6 +144,9 @@ bool CDebugDump::GetAndSetLock(const std::string& pLockFile, const std::string& } m_nFD = fd; m_bUnlock = true; + + comm_layer_inner_debug("Locking '"+pLockFile+"'..."); + return true; } @@ -155,6 +167,7 @@ void CDebugDump::UnLock() std::string lockFile = m_sDebugDumpDir + ".lock"; if (m_bUnlock) { + comm_layer_inner_debug("UnLocking '"+lockFile+"'..."); close(m_nFD); m_nFD = -1; remove(lockFile.c_str()); |