diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-01 18:47:50 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-01 18:47:50 +0100 |
| commit | 3b1dd4985ac7e32a3a1a498214bd26df29089dbc (patch) | |
| tree | 3c7366d29f387fa20db1b72cc2fec2a5a80f3d3e /lib/plugins/CCpp.cpp | |
| parent | 7048013d2019b50b5b9af5a13d3f30e5cdafe4f8 (diff) | |
| download | abrt-3b1dd4985ac7e32a3a1a498214bd26df29089dbc.tar.gz abrt-3b1dd4985ac7e32a3a1a498214bd26df29089dbc.tar.xz abrt-3b1dd4985ac7e32a3a1a498214bd26df29089dbc.zip | |
introduce abrt_action.conf; use it for post-create step
This patch replaces only the post-create step with new logic
(the step which happens when abrtd detects fresh crash dump dir
and needs to decide what to do with it), but it turns out
this step is one of hard ones: it needs special handling
of UUID. So a good chunk of hard-ish stuff is already in this patch.
It also contains logic to collect the log from actions,
even though so far it is simply logged. Other steps
(like reporting step) will pipe it to clients.
post-create step simply has no client to pipe output to.
But the code is there already.
GetLocalUUID() members in all plugins are unused now
and are deleted from all classes.
Next patches will move run_event() function into libABRT,
so that it can be used from e.g. abrt-handle-crashdump utility
if/when we will write it, from clients directly and so on.
For now, it lives in MiddleWare.cpp since it is only used there.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/plugins/CCpp.cpp')
| -rw-r--r-- | lib/plugins/CCpp.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/lib/plugins/CCpp.cpp b/lib/plugins/CCpp.cpp index ed5ab3b6..7415891f 100644 --- a/lib/plugins/CCpp.cpp +++ b/lib/plugins/CCpp.cpp @@ -265,51 +265,6 @@ static void trim_debuginfo_cache(unsigned max_mb) } } -string CAnalyzerCCpp::GetLocalUUID(const char *pDebugDumpDir) -{ - string ret; - - struct dump_dir *dd = dd_opendir(pDebugDumpDir, /*flags:*/ 0); - if (!dd) - return ret; /* "" */ - - if (!dd_exist(dd, CD_UUID)) - { - dd_close(dd); - - pid_t pid = fork(); - if (pid < 0) - { - perror_msg("fork"); - return ret; /* "" */ - } - if (pid == 0) /* child */ - { - char *argv[4]; /* abrt-action-analyze-c -d DIR <NULL> */ - char **pp = argv; - *pp++ = (char*)"abrt-action-analyze-c"; - *pp++ = (char*)"-d"; - *pp++ = (char*)pDebugDumpDir; - *pp = NULL; - - execvp(argv[0], argv); - perror_msg_and_die("Can't execute '%s'", argv[0]); - } - /* parent */ - waitpid(pid, NULL, 0); - - dd = dd_opendir(pDebugDumpDir, /*flags:*/ 0); - if (!dd) - return ret; /* "" */ - } - - char *uuid = dd_load_text(dd, CD_UUID); - dd_close(dd); - ret = uuid; - free(uuid); - return ret; -} - string CAnalyzerCCpp::GetGlobalUUID(const char *pDebugDumpDir) { struct dump_dir *dd = dd_opendir(pDebugDumpDir, /*flags:*/ 0); |
