From 82fa5d21678f99a8b9d6a3ed9735a5e4e5356707 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Nov 2010 17:26:02 +0100 Subject: [PATCH] SFTP: provide the numerical error reason on failure --- example/sftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/sftp.c b/example/sftp.c index 07329af0..21c89da6 100644 --- a/example/sftp.c +++ b/example/sftp.c @@ -245,7 +245,8 @@ int main(int argc, char *argv[]) libssh2_sftp_open(sftp_session, sftppath, LIBSSH2_FXF_READ, 0); if (!sftp_handle) { - fprintf(stderr, "Unable to open file with SFTP\n"); + fprintf(stderr, "Unable to open file with SFTP: %ld\n", + libssh2_sftp_last_error(sftp_session)); goto shutdown; } fprintf(stderr, "libssh2_sftp_open() is done, now receive data!\n");