summaryrefslogtreecommitdiffstats
path: root/src/Hooks/abrt-hook-python.cpp
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-12-18 19:12:50 +0100
committerKarel Klic <kklic@redhat.com>2009-12-18 19:12:50 +0100
commite7661d7e411172ddad8838040ded025ad6bfbb14 (patch)
treef2451b553b4fcf959bd2bfc29172f9fb855e5fdd /src/Hooks/abrt-hook-python.cpp
parentce1904e24b576a7356488852a240d777717b2598 (diff)
parent46b2fb8df8d4e025f5bbdd9f53be1f658a9e82c6 (diff)
downloadabrt-e7661d7e411172ddad8838040ded025ad6bfbb14.tar.gz
abrt-e7661d7e411172ddad8838040ded025ad6bfbb14.tar.xz
abrt-e7661d7e411172ddad8838040ded025ad6bfbb14.zip
Merge branch 'master' of git://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src/Hooks/abrt-hook-python.cpp')
-rw-r--r--src/Hooks/abrt-hook-python.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/Hooks/abrt-hook-python.cpp b/src/Hooks/abrt-hook-python.cpp
index cd17e40..3f79d28 100644
--- a/src/Hooks/abrt-hook-python.cpp
+++ b/src/Hooks/abrt-hook-python.cpp
@@ -34,21 +34,23 @@
static char *pid;
static char *executable;
static char *uuid;
-static char *cmdline;
int main(int argc, char** argv)
{
+ // Error if daemon is not running.
+ if (!daemon_is_ok())
+ error_msg_and_die("Daemon is not running.");
+
// Parse options
static const struct option longopts[] = {
// name , has_arg , flag, val
{ "pid" , required_argument, NULL, 'p' },
{ "executable", required_argument, NULL, 'e' },
{ "uuid" , required_argument, NULL, 'u' },
- { "cmdline" , required_argument, NULL, 'c' },
{ 0 },
};
int opt;
- while ((opt = getopt_long(argc, argv, "p:e:u:c:l:", longopts, NULL)) != -1)
+ while ((opt = getopt_long(argc, argv, "p:e:u:l:", longopts, NULL)) != -1)
{
switch (opt)
{
@@ -61,9 +63,6 @@ int main(int argc, char** argv)
case 'u':
uuid = optarg;
break;
- case 'c':
- cmdline = optarg;
- break;
default:
usage:
error_msg_and_die(
@@ -72,7 +71,6 @@ int main(int argc, char** argv)
" -p,--pid PID PID of process that caused the crash\n"
" -p,--executable PATH absolute path to the program that crashed\n"
" -u,--uuid UUID hash generated from the backtrace\n"
- " -c,--cmdline TEXT command line of the crashed program\n"
);
}
}
@@ -103,8 +101,12 @@ int main(int argc, char** argv)
dd.SaveText(FILENAME_ANALYZER, "Python");
if (executable)
dd.SaveText(FILENAME_EXECUTABLE, executable);
- if (cmdline)
- dd.SaveText("cmdline", cmdline);
+
+ pid_t pidt = xatoi(pid);
+ char *cmdline = get_cmdline(pidt);
+ dd.SaveText("cmdline", cmdline);
+ free(cmdline);
+
if (uuid)
dd.SaveText("uuid", uuid);