diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-13 18:12:39 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-13 18:12:39 +0200 |
commit | e0af345334d225356d9f2fdb9a9b250339ffcea2 (patch) | |
tree | 5b7ec9de59d6f97ace759fadcd846c84a79267c8 /src/hooks | |
parent | 6f5f5611067d4c3696a85bf8eadc9944629e4deb (diff) | |
download | abrt-e0af345334d225356d9f2fdb9a9b250339ffcea2.tar.gz abrt-e0af345334d225356d9f2fdb9a9b250339ffcea2.tar.xz abrt-e0af345334d225356d9f2fdb9a9b250339ffcea2.zip |
better name for abrt-FOO coredumps
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/hooks')
-rw-r--r-- | src/hooks/abrt-hook-ccpp.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hooks/abrt-hook-ccpp.cpp b/src/hooks/abrt-hook-ccpp.cpp index 656d5e29..c4b71afb 100644 --- a/src/hooks/abrt-hook-ccpp.cpp +++ b/src/hooks/abrt-hook-ccpp.cpp @@ -388,14 +388,15 @@ int main(int argc, char** argv) close(fd); } - if (strstr(executable, "/abrt")) + const char *last_slash = strrchr(executable, '/'); + if (last_slash && strncmp(++last_slash, "abrt", 4)) { /* If abrtd/abrt-foo crashes, we don't want to create a _directory_, * since that can make new copy of abrtd to process it, * and maybe crash again... * Unlike dirs, mere files are ignored by abrtd. */ - snprintf(path, sizeof(path), "%s/abrt-coredump", dddir); + snprintf(path, sizeof(path), "%s/%s-coredump", dddir, last_slash); int abrt_core_fd = xopen3(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); off_t core_size = copyfd_eof(STDIN_FILENO, abrt_core_fd, COPYFD_SPARSE); if (core_size < 0 || fsync(abrt_core_fd) != 0) |