diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-06 12:41:24 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-06 12:41:24 +0100 |
| commit | c8e9e69f96c2bd0b9248d6dfab91e2d27ab8e608 (patch) | |
| tree | 237a9d3f821d01932111e9fa59af5d3e44b988c8 /lib/Plugins/SOSreport.cpp | |
| parent | 03bbbf8eff11cf68a7e2325ca310e02bf3757193 (diff) | |
| download | abrt-c8e9e69f96c2bd0b9248d6dfab91e2d27ab8e608.tar.gz abrt-c8e9e69f96c2bd0b9248d6dfab91e2d27ab8e608.tar.xz abrt-c8e9e69f96c2bd0b9248d6dfab91e2d27ab8e608.zip | |
mass replace of const string& params by const char*
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Plugins/SOSreport.cpp')
| -rw-r--r-- | lib/Plugins/SOSreport.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Plugins/SOSreport.cpp b/lib/Plugins/SOSreport.cpp index 4938f7d..744550b 100644 --- a/lib/Plugins/SOSreport.cpp +++ b/lib/Plugins/SOSreport.cpp @@ -114,8 +114,7 @@ static void ParseArgs(const char *psArgs, vector_string_t& pArgs) } } -void CActionSOSreport::Run(const std::string& pActionDir, - const std::string& pArgs) +void CActionSOSreport::Run(const char *pActionDir, const char *pArgs) { update_client(_("Executing SOSreport plugin...")); @@ -128,25 +127,25 @@ void CActionSOSreport::Run(const std::string& pActionDir, std::string command; vector_string_t args; - ParseArgs(pArgs.c_str(), args); + ParseArgs(pArgs, args); if (args.size() == 0 || args[0] == "") { - command = std::string(command_default); + command = command_default; } else { - command = std::string(command_prefix) + ' ' + args[0] + " 2>&1"; + command = ssprintf("%s %s 2>&1", command_prefix, args[0].c_str()); } update_client(_("running sosreport: ") + command); FILE *fp = popen(command.c_str(), "r"); - if (fp == NULL) { - throw CABRTException(EXCEP_PLUGIN, std::string("CActionSOSreport::Run(): cannot execute ") + command); + throw CABRTException(EXCEP_PLUGIN, ssprintf("Can't execute '%s'", command.c_str())); } +//vda TODO: fix this mess std::ostringstream output_stream; __gnu_cxx::stdio_filebuf<char> command_output_buffer(fp, std::ios_base::in); @@ -159,7 +158,7 @@ void CActionSOSreport::Run(const std::string& pActionDir, std::string output = output_stream.str(); std::string sosreport_filename = ParseFilename(output); - std::string sosreport_dd_filename = pActionDir + "/sosreport.tar.bz2"; + std::string sosreport_dd_filename = concat_path_file(pActionDir, "sosreport.tar.bz2"); CDebugDump dd; dd.Open(pActionDir); |
