diff options
author | Zdenek Prikryl <zprikryl@redhat.com> | 2009-02-05 19:21:41 +0100 |
---|---|---|
committer | Zdenek Prikryl <zprikryl@redhat.com> | 2009-02-05 19:21:41 +0100 |
commit | f48e217149c36a49cb64221bfca752c53d8c1bee (patch) | |
tree | 1e3a8e315d38677c6780df1bbdab5682b4891e78 /lib/Utils | |
parent | 59a7de9e2d8a2bb08ba461fc305d65a2fdba1a82 (diff) | |
download | abrt-f48e217149c36a49cb64221bfca752c53d8c1bee.tar.gz abrt-f48e217149c36a49cb64221bfca752c53d8c1bee.tar.xz abrt-f48e217149c36a49cb64221bfca752c53d8c1bee.zip |
DebugDump can get package name now
Diffstat (limited to 'lib/Utils')
-rw-r--r-- | lib/Utils/DebugDump.cpp | 13 | ||||
-rw-r--r-- | lib/Utils/Makefile.am | 4 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index e35ec4dd..9fd887fd 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -20,6 +20,7 @@ */ #include "DebugDump.h" +#include "Packages.h" #include <fstream> #include <iostream> #include <sstream> @@ -223,12 +224,20 @@ void CDebugDump::SaveProc(const std::string& pPID) std::string path = "/proc/"+pPID+"/exe"; std::string data; char executable[PATH_MAX]; + int len; - if (readlink(path.c_str(), executable, PATH_MAX) == 0) + if ((len = readlink(path.c_str(), executable, PATH_MAX)) != -1) { + executable[len] = '\0'; SaveText(FILENAME_EXECUTABLE, executable); } + CPackages packages; + while (!packages.SearchFile(executable)) {} + while (!packages.GetStatus()) {} + std::string package = packages.GetSearchFileReply(); + SaveText(FILENAME_PACKAGE, package); + path = "/proc/"+pPID+"/status"; std::string uid = "0"; int ii = 0; @@ -242,6 +251,4 @@ void CDebugDump::SaveProc(const std::string& pPID) ii++; } SaveText(FILENAME_UID, uid); - - // TODO: Use packagekit } diff --git a/lib/Utils/Makefile.am b/lib/Utils/Makefile.am index 71a8e98d..2b47b1ee 100644 --- a/lib/Utils/Makefile.am +++ b/lib/Utils/Makefile.am @@ -1,6 +1,8 @@ lib_LTLIBRARIES = libUtils.la -libUtils_la_SOURCES = DebugDump.cpp DebugDump.h +libUtils_la_SOURCES = DebugDump.cpp DebugDump.h Packages.cpp Packages.h libUtils_la_LDFLAGS = -version-info 0:1:0 +libUtils_la_CPPFLAGS = $(PACKAGEKIT_GLIB_CFLAGS) +libUtils_la_LIBADD = $(PACKAGEKIT_GLIB_LIBS) install-data-local: $(mkdir_p) '$(DEBUG_DUMPS_DIR)'
\ No newline at end of file |