Execute a command using the shell. Returns true if and only if the command's exit status was 0.
| 44 | // Execute a command using the shell. |
| 45 | // Returns true if and only if the command's exit status was 0. |
| 46 | bool ExecuteCommand(const std::string& command) { |
| 47 | errno = 0; |
| 48 | int status = std::system(command.c_str()); |
| 49 | assert(errno == 0 && "failed to execute command"); |
| 50 | // The result returned by 'system' is implementation-defined, but is |
| 51 | // usually the case that the returned value is 0 when the command's exit |
| 52 | // code was 0. We are assuming that here, and that's all we depend on. |
| 53 | return status == 0; |
| 54 | } |
| 55 | |
| 56 | // Status and actions to perform after parsing command-line arguments. |
| 57 | enum class FuzzActions { |