diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-02-09 21:24:45 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-02-09 21:24:45 +0100 |
commit | 3192f468fa5e7f10c664cca671246f962d1d36d1 (patch) | |
tree | 67d0dbb2c06149eb66c06b9d639144233e3149fe /lib/Utils/DebugDump.cpp | |
parent | 7a14f59368f7221274bd74504700fc36031e9c3f (diff) | |
parent | f48e217149c36a49cb64221bfca752c53d8c1bee (diff) | |
download | abrt-3192f468fa5e7f10c664cca671246f962d1d36d1.tar.gz abrt-3192f468fa5e7f10c664cca671246f962d1d36d1.tar.xz abrt-3192f468fa5e7f10c664cca671246f962d1d36d1.zip |
Merge branch 'master' of git://git.fedorahosted.org/git/crash-catcher
Diffstat (limited to 'lib/Utils/DebugDump.cpp')
-rw-r--r-- | lib/Utils/DebugDump.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index e35ec4d..9fd887f 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 } |