summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-10-27 17:02:55 (GMT)
committerDenys Vlasenko <dvlasenk@redhat.com>2011-10-27 17:02:55 (GMT)
commit75597ad7833d8982b2a1cf83041ca8b3a3101b2e (patch)
treec985d6741bfca31c459e1f527804ae52850a38e3
parent8f443f78749d62a6046b3cd1a77e0ce9b1ba2b44 (diff)
downloadabrt-75597ad7833d8982b2a1cf83041ca8b3a3101b2e.zip
abrt-75597ad7833d8982b2a1cf83041ca8b3a3101b2e.tar.gz
abrt-75597ad7833d8982b2a1cf83041ca8b3a3101b2e.tar.xz
abrt-hook-ccpp: save PID and current directory
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--src/hooks/abrt-hook-ccpp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
index 8bf5165..e73c352 100644
--- a/src/hooks/abrt-hook-ccpp.c
+++ b/src/hooks/abrt-hook-ccpp.c
@@ -346,6 +346,7 @@ int main(int argc, char** argv)
/* set to max possible >0 value */
ulimit_c = ~((off_t)1 << (sizeof(off_t)*8-1));
}
+ const char *pid_str = argv[3];
pid_t pid = xatoi_positive(argv[3]);
uid_t uid = xatoi_positive(argv[4]);
if (errno || pid <= 0)
@@ -541,6 +542,9 @@ int main(int argc, char** argv)
dd_save_text(dd, FILENAME_ANALYZER, "CCpp");
dd_save_text(dd, FILENAME_EXECUTABLE, executable);
+ dd_save_text(dd, FILENAME_PID, pid_str);
+ if (user_pwd)
+ dd_save_text(dd, FILENAME_PWD, user_pwd);
char *reason = xasprintf("Process %s was killed by signal %s (SIG%s)",
executable, signal_str, signame ? signame : signal_str);