summaryrefslogtreecommitdiffstats
path: root/lib/Utils/DebugDump.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-03-05 17:03:32 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-03-05 17:03:32 +0100
commitdbbc2df18f5441d7b298c5d32e4199aa56f08ce0 (patch)
treeadf4bce0a6a02d29da010f91c8264c4dd38ca465 /lib/Utils/DebugDump.cpp
parent9e7602b032c2187887c8164fa23c37d6daf28ac0 (diff)
downloadabrt-dbbc2df18f5441d7b298c5d32e4199aa56f08ce0.tar.gz
abrt-dbbc2df18f5441d7b298c5d32e4199aa56f08ce0.tar.xz
abrt-dbbc2df18f5441d7b298c5d32e4199aa56f08ce0.zip
add ProcessUnpackaged option to abrt.conf
Based on patch by Pekka Pietikainen <pp@ee.oulu.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
-rw-r--r--lib/Utils/DebugDump.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index 97c387c5..2d8da1ac 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -320,7 +320,23 @@ void CDebugDump::Create(const char *pDir, uid_t uid)
}
SaveText(CD_UID, to_string(uid).c_str());
- SaveKernelArchitectureRelease();
+
+ {
+ struct utsname buf;
+ if (uname(&buf) != 0)
+ {
+ perror_msg_and_die("uname");
+ }
+ SaveText(FILENAME_KERNEL, buf.release);
+ SaveText(FILENAME_ARCHITECTURE, buf.machine);
+ std::string release;
+ LoadTextFile("/etc/redhat-release", release);
+ const char *release_ptr = release.c_str();
+ unsigned len_1st_str = strchrnul(release_ptr, '\n') - release_ptr;
+ release.erase(len_1st_str); /* usually simply removes trailing '\n' */
+ SaveText(FILENAME_RELEASE, release.c_str());
+ }
+
time_t t = time(NULL);
SaveText(FILENAME_TIME, to_string(t).c_str());
}
@@ -374,22 +390,6 @@ void CDebugDump::Close()
m_bOpened = false;
}
-void CDebugDump::SaveKernelArchitectureRelease()
-{
- struct utsname buf;
- if (uname(&buf) == 0)
- {
- SaveText(FILENAME_KERNEL, buf.release);
- SaveText(FILENAME_ARCHITECTURE, buf.machine);
- }
- std::string release;
- LoadTextFile("/etc/redhat-release", release);
- const char *release_ptr = release.c_str();
- unsigned len_1st_str = strchrnul(release_ptr, '\n') - release_ptr;
- release.erase(len_1st_str); /* usually simply removes trailing '\n' */
- SaveText(FILENAME_RELEASE, release.c_str());
-}
-
static void LoadTextFile(const char *pPath, std::string& pData)
{
FILE *fp = fopen(pPath, "r");