summaryrefslogtreecommitdiffstats
path: root/src/Hooks/abrt-hook-ccpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hooks/abrt-hook-ccpp.cpp')
-rw-r--r--src/Hooks/abrt-hook-ccpp.cpp10
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)