summaryrefslogtreecommitdiffstats
path: root/lib/Utils
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
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')
-rw-r--r--lib/Utils/DebugDump.cpp34
-rw-r--r--lib/Utils/DebugDump.h2
2 files changed, 17 insertions, 19 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");
diff --git a/lib/Utils/DebugDump.h b/lib/Utils/DebugDump.h
index a5de743f..f8487a65 100644
--- a/lib/Utils/DebugDump.h
+++ b/lib/Utils/DebugDump.h
@@ -34,8 +34,6 @@ class CDebugDump
uid_t m_uid;
gid_t m_gid;
- void SaveKernelArchitectureRelease();
-
void Lock();
void UnLock();