diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-06-03 16:25:51 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-06-03 16:25:51 +0200 |
commit | 2cd64dab084dd27fe6d9bf148ee3e9234c73b72a (patch) | |
tree | a151cca380b803f5e18bff84e2a0bbb94b8f37bb /src/Hooks | |
parent | b69e4c744b48ed2f70878ccd1535ab9fad2bd959 (diff) | |
download | abrt-2cd64dab084dd27fe6d9bf148ee3e9234c73b72a.tar.gz abrt-2cd64dab084dd27fe6d9bf148ee3e9234c73b72a.tar.xz abrt-2cd64dab084dd27fe6d9bf148ee3e9234c73b72a.zip |
remove "(deleted)" from executable path rhbz#593037
Diffstat (limited to 'src/Hooks')
-rw-r--r-- | src/Hooks/abrt-hook-ccpp.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Hooks/abrt-hook-ccpp.cpp b/src/Hooks/abrt-hook-ccpp.cpp index b72e8be8..d50f3cb3 100644 --- a/src/Hooks/abrt-hook-ccpp.cpp +++ b/src/Hooks/abrt-hook-ccpp.cpp @@ -137,7 +137,15 @@ static char* get_executable(pid_t pid) char buf[sizeof("/proc/%lu/exe") + sizeof(long)*3]; sprintf(buf, "/proc/%lu/exe", (long)pid); - return malloc_readlink(buf); + char *executable = malloc_readlink(buf); + /* find and cut off " (deleted)" from the path */ + char *deleted = executable + strlen(executable) - strlen(" (deleted)"); + if (deleted > executable && strcmp(deleted, " (deleted)") == 0) + { + *deleted = '\0'; + log("file %s seems to be deleted", executable); + } + return executable; } static char* get_cwd(pid_t pid) |