From a3d0068a7f76208cad48322d1de4efbf86a7be75 Mon Sep 17 00:00:00 2001 From: Philip Schuchardt Date: Fri, 9 Jul 2021 19:10:39 -0400 Subject: [PATCH] Fix issue #10 - exitcode not reporting correctly Switched from channel_send_eof() to channel_close() fixes the exitcode issue --- src/Ssh2Channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ssh2Channel.cpp b/src/Ssh2Channel.cpp index b70b359..6589a5b 100644 --- a/src/Ssh2Channel.cpp +++ b/src/Ssh2Channel.cpp @@ -200,7 +200,7 @@ std::error_code Ssh2Channel::closeChannelSession() std::error_code error_code = ssh2_success; libssh2_channel_flush_ex(ssh2_channel_, 0); libssh2_channel_flush_ex(ssh2_channel_, 1); - const int ssh2_method_result = libssh2_channel_send_eof(ssh2_channel_); + const int ssh2_method_result = libssh2_channel_close(ssh2_channel_); switch (ssh2_method_result) { case LIBSSH2_ERROR_EAGAIN: setSsh2ChannelState(ChannelStates::Closing);