summaryrefslogtreecommitdiffstats
path: root/lib/Utils/DebugDump.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 07:22:13 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 07:22:13 +0100
commit14ef0cfe72faf6696df3ef8f42927e9458ccbeeb (patch)
treec5d3a3169fc31f212d507553beb67920be92ebcd /lib/Utils/DebugDump.cpp
parentb1c4304104910c4bc066cd43f9784fe2f3ddf1ad (diff)
downloadabrt-14ef0cfe72faf6696df3ef8f42927e9458ccbeeb.tar.gz
abrt-14ef0cfe72faf6696df3ef8f42927e9458ccbeeb.tar.xz
abrt-14ef0cfe72faf6696df3ef8f42927e9458ccbeeb.zip
*: misc fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
-rw-r--r--lib/Utils/DebugDump.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index cb3a082c..dd992aab 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -115,7 +115,15 @@ static bool GetAndSetLock(const char* pLockFile, const char* pPID)
char pid_buf[sizeof(pid_t)*3 + 4];
ssize_t r = readlink(pLockFile, pid_buf, sizeof(pid_buf) - 1);
if (r < 0)
+ {
+ if (errno == ENOENT)
+ {
+ /* Looks like pLockFile was deleted */
+ usleep(10 * 1000); /* avoid CPU eating loop */
+ continue;
+ }
perror_msg_and_die("Can't read lock file '%s'", pLockFile);
+ }
pid_buf[r] = '\0';
if (strcmp(pid_buf, pPID) == 0)
@@ -228,7 +236,7 @@ void CDebugDump::UnLock()
}
}
-void CDebugDump::Create(const char *pDir, int64_t uid)
+void CDebugDump::Create(const char *pDir, uid_t uid)
{
if (m_bOpened)
{