block/ssh: Drop superfluous libssh2_session_last_errno() calls
libssh2_session_last_error() already returns the error code. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
d61563b235
commit
04bc7c0e38
@ -121,10 +121,9 @@ session_error_report(BDRVSSHState *s, const char *fs, ...)
|
|||||||
char *ssh_err;
|
char *ssh_err;
|
||||||
int ssh_err_code;
|
int ssh_err_code;
|
||||||
|
|
||||||
libssh2_session_last_error((s)->session, &ssh_err, NULL, 0);
|
|
||||||
/* This is not an errno. See <libssh2.h>. */
|
/* This is not an errno. See <libssh2.h>. */
|
||||||
ssh_err_code = libssh2_session_last_errno((s)->session);
|
ssh_err_code = libssh2_session_last_error(s->session,
|
||||||
|
&ssh_err, NULL, 0);
|
||||||
error_printf(": %s (libssh2 error code: %d)", ssh_err, ssh_err_code);
|
error_printf(": %s (libssh2 error code: %d)", ssh_err, ssh_err_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,9 +144,9 @@ sftp_error_report(BDRVSSHState *s, const char *fs, ...)
|
|||||||
int ssh_err_code;
|
int ssh_err_code;
|
||||||
unsigned long sftp_err_code;
|
unsigned long sftp_err_code;
|
||||||
|
|
||||||
libssh2_session_last_error((s)->session, &ssh_err, NULL, 0);
|
|
||||||
/* This is not an errno. See <libssh2.h>. */
|
/* This is not an errno. See <libssh2.h>. */
|
||||||
ssh_err_code = libssh2_session_last_errno((s)->session);
|
ssh_err_code = libssh2_session_last_error(s->session,
|
||||||
|
&ssh_err, NULL, 0);
|
||||||
/* See <libssh2_sftp.h>. */
|
/* See <libssh2_sftp.h>. */
|
||||||
sftp_err_code = libssh2_sftp_last_error((s)->sftp);
|
sftp_err_code = libssh2_sftp_last_error((s)->sftp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user