Util
- Made arg vector const. - Applied coding conventions.
This commit is contained in:
@@ -392,7 +392,7 @@ void combine (std::vector <int>& dest, const std::vector <int>& source)
|
||||
// Run an external executable with execvp. This means stdio goes to
|
||||
// the child process, so that it can receive user input (e.g. passwords).
|
||||
//
|
||||
int execute(const std::string& executable, std::vector<std::string> arguments)
|
||||
int execute (const std::string& executable, const std::vector<std::string>& arguments)
|
||||
{
|
||||
if (executable == "")
|
||||
return -1;
|
||||
@@ -404,11 +404,9 @@ int execute(const std::string& executable, std::vector<std::string> arguments)
|
||||
|
||||
std::string cmdline = executable;
|
||||
|
||||
std::vector <std::string>::iterator it;
|
||||
std::vector <std::string>::const_iterator it;
|
||||
for (it = arguments.begin (); it != arguments.end (); ++it)
|
||||
{
|
||||
cmdline += " " + (std::string) *it;
|
||||
}
|
||||
|
||||
context.debug ("Executing: " + std::string (shell) + " " + std::string (opt) + " " + cmdline);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ void uuid_unparse_lower (uuid_t uu, char *out);
|
||||
#endif
|
||||
const std::string uuid ();
|
||||
|
||||
int execute (const std::string&, std::vector<std::string>);
|
||||
int execute (const std::string&, const std::vector <std::string>&);
|
||||
|
||||
#ifdef SOLARIS
|
||||
#define LOCK_SH 1
|
||||
|
||||
Reference in New Issue
Block a user