summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-04-09 21:01:56 +0000
committerChris Wilson <chris+github@qwirx.com>2008-04-09 21:01:56 +0000
commitef82c708eeabcfc0fb752b934c497004aee69e1c (patch)
tree26b1c3f6d5fbe0e0196d3a687706f7aabdba87ba /bin
parenta946ee35e178b1f3b0aa783e4fbb3c70e2c502aa (diff)
Check the return code from system commands in bbackupquery, and if not
zero, give a warning and set the bbackupquery return code to COMMAND_RETURN_ERROR. Check for Restore_TargetPathNotFound on all platforms as it's not specific to Windows.
Diffstat (limited to 'bin')
-rw-r--r--bin/bbackupquery/BackupQueries.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp
index 0faa4770..61b7e85b 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/bin/bbackupquery/BackupQueries.cpp
@@ -117,7 +117,13 @@ void BackupQueries::DoCommand(const char *Command, bool isFromCommandLine)
if(Command[0] == 's' && Command[1] == 'h' && Command[2] == ' ' && Command[3] != '\0')
{
// Yes, run shell command
- ::system(Command + 3);
+ int result = ::system(Command + 3);
+ if(result != 0)
+ {
+ BOX_WARNING("System command returned error code " <<
+ result);
+ SetReturnCode(COMMAND_RETURN_ERROR);
+ }
return;
}
@@ -2054,14 +2060,12 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b
SetReturnCode(COMMAND_RETURN_ERROR);
break;
- #ifdef WIN32
case Restore_TargetPathNotFound:
BOX_ERROR("The target directory path does not exist.\n"
"To restore to a directory whose parent "
"does not exist, create the parent first.");
SetReturnCode(COMMAND_RETURN_ERROR);
break;
- #endif
case Restore_UnknownError:
BOX_ERROR("Unknown error during restore.");