From ef82c708eeabcfc0fb752b934c497004aee69e1c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 9 Apr 2008 21:01:56 +0000 Subject: 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. --- bin/bbackupquery/BackupQueries.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin/bbackupquery') 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 &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."); -- cgit v1.2.3