mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-17 22:03:07 -06:00
19 lines
337 B
C++
19 lines
337 B
C++
#include "SSH.h"
|
|
|
|
namespace Upp {
|
|
|
|
int SshExec::Execute(const String& cmd, String& out, String& err)
|
|
{
|
|
if(RequestExec(cmd)) {
|
|
int size = max(ssh->chunk_size, 1024);
|
|
out = Get(size);
|
|
err = GetStdErr(size);
|
|
if(!IsError() &&
|
|
PutGetEof() &&
|
|
Close() &&
|
|
WaitClose())
|
|
return GetExitCode();
|
|
}
|
|
return GetError();
|
|
}
|
|
}
|