1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

Add libssh2_channel_get_exit_signal.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
This commit is contained in:
Tommy Lindgren
2010-10-13 15:31:06 +02:00
committed by Simon Josefsson
parent 70d6bd6c6f
commit 6140ec2de3
6 changed files with 117 additions and 1 deletions

View File

@ -86,6 +86,7 @@ int main(int argc, char *argv[])
LIBSSH2_CHANNEL *channel;
int rc;
int exitcode;
char *exitsignal;
int bytecount = 0;
size_t len;
LIBSSH2_KNOWNHOSTS *nh;
@ -286,8 +287,13 @@ int main(int argc, char *argv[])
if( rc == 0 )
{
exitcode = libssh2_channel_get_exit_status( channel );
libssh2_channel_get_exit_signal(channel, &exitsignal, NULL, NULL, NULL, NULL, NULL);
}
printf("\nEXIT: %d bytecount: %d\n", exitcode, bytecount);
if (exitsignal)
printf("\nGot signal: %s\n", exitsignal);
else
printf("\nEXIT: %d bytecount: %d\n", exitcode, bytecount);
libssh2_channel_free(channel);
channel = NULL;