summaryrefslogtreecommitdiffstats
path: root/lib/Utils/DebugDump.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-30 15:15:08 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-30 15:15:08 +0200
commit5632ddb849821bf8c4fac9f4aa8c4779575eef97 (patch)
treec0f5cdeabec71de882f7d6dcbfffc0daeb0c961a /lib/Utils/DebugDump.cpp
parent0a901ba3e651a70984e980f61619b005031a71f0 (diff)
downloadabrt-5632ddb849821bf8c4fac9f4aa8c4779575eef97.tar.gz
abrt-5632ddb849821bf8c4fac9f4aa8c4779575eef97.tar.xz
abrt-5632ddb849821bf8c4fac9f4aa8c4779575eef97.zip
fix all instances of dent->d_type == DT_REG checks
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
-rw-r--r--lib/Utils/DebugDump.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index 60564431..43eb3244 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -484,16 +484,10 @@ bool CDebugDump::GetNextFile(std::string& pFileName, std::string& pContent, bool
struct dirent *dent;
while ((dent = readdir(m_pGetNextFileDir)) != NULL)
{
- struct stat statbuf;
- std::string fullname = m_sDebugDumpDir + "/" + dent->d_name;
-
- /* some filesystems do not report the type! they report DT_UNKNOWN */
- if (dent->d_type == DT_REG
- || (dent->d_type == DT_UNKNOWN
- && lstat(fullname.c_str(), &statbuf) == 0
- && S_ISREG(statbuf.st_mode)
- )
- ) {
+ if (is_regular_file(dent, m_sDebugDumpDir.c_str()))
+ {
+ std::string fullname = m_sDebugDumpDir + "/" + dent->d_name;
+
pFileName = dent->d_name;
if (IsTextFile(fullname))
{