summaryrefslogtreecommitdiffstats
path: root/src/Hooks/CCpp.cpp
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-11-12 16:58:07 +0100
committerKarel Klic <kklic@redhat.com>2009-11-12 16:58:07 +0100
commit32cee84a34c005fe0d2863f439007ec633687fa8 (patch)
tree149ca7014e4295de3788f28ae88e9d9d7003da46 /src/Hooks/CCpp.cpp
parent5a8a8a6c99c9067e0dfcce839c32826a2badff0b (diff)
parent3938e6e075867ae3a349ba307ee672aa458d2662 (diff)
downloadabrt-32cee84a34c005fe0d2863f439007ec633687fa8.tar.gz
abrt-32cee84a34c005fe0d2863f439007ec633687fa8.tar.xz
abrt-32cee84a34c005fe0d2863f439007ec633687fa8.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src/Hooks/CCpp.cpp')
-rw-r--r--src/Hooks/CCpp.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp
index 0f95d05b..3ab8f406 100644
--- a/src/Hooks/CCpp.cpp
+++ b/src/Hooks/CCpp.cpp
@@ -205,19 +205,19 @@ int main(int argc, char** argv)
dd.Close();
perror_msg_and_die("can't open '%s'", path);
}
- if (copyfd_eof(STDIN_FILENO, fd) < 0)
+ off_t size = copyfd_eof(STDIN_FILENO, fd);
+ if (size < 0 || close(fd) != 0)
{
- /* close(fd); - why bother? */
+ unlink(path);
dd.Delete();
dd.Close();
/* copyfd_eof logs the error including errno string,
* but it does not log file name */
error_msg_and_die("error saving coredump to %s", path);
}
- /* close(fd); - why bother? */
- /* free(executable); */
+ /* free(executable); - why bother? */
/* free(cmdline); */
- log("saved core dump of pid %u to %s", (int)pid, path);
+ log("saved core dump of pid %u to %s (%llu bytes)", (int)pid, path, (long long)size);
}
catch (CABRTException& e)
{