Clean up Transport::execute() and callers.

- Ensure that the real exit code of the child program is retrieved
  using WEXITSTATUS().

- Centralise the handling of code 127, which means that the child
  shell process could not execute its child (ssh, rsync, or curl.)

Signed-off-by: Russell Steicke <russells@adelie.cx>
This commit is contained in:
Russell Steicke
2013-03-03 20:57:26 +08:00
committed by Paul Beckingham
parent 3dab5a1cb1
commit 1428a4135b
7 changed files with 41 additions and 33 deletions

View File

@@ -65,8 +65,8 @@ void TransportRSYNC::send(const std::string& source)
_arguments.push_back (_uri._host + "::" + _uri._path);
}
if (execute())
throw std::string (STRING_TRANSPORT_RSYNC_NORUN);
if (execute ())
throw std::string (STRING_TRANSPORT_RSYNC_FAIL);
}
////////////////////////////////////////////////////////////////////////////////
@@ -95,8 +95,8 @@ void TransportRSYNC::recv(std::string target)
_arguments.push_back (target);
if (execute())
throw std::string (STRING_TRANSPORT_RSYNC_NORUN);
if (execute ())
throw std::string (STRING_TRANSPORT_RSYNC_FAIL);
}
////////////////////////////////////////////////////////////////////////////////