thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-block-ssh-Drop-superfluous-libssh2_session_last_errn.patch

05bba0
From 8d385a8bc9d20d1c0ec09579f14a98294b448985 Mon Sep 17 00:00:00 2001
05bba0
From: Richard Jones <rjones@redhat.com>
05bba0
Date: Mon, 8 Jun 2015 11:56:55 +0200
05bba0
Subject: [PATCH 02/30] block/ssh: Drop superfluous
05bba0
 libssh2_session_last_errno() calls
05bba0
05bba0
Message-id: <1433764620-20506-2-git-send-email-rjones@redhat.com>
05bba0
Patchwork-id: 65477
05bba0
O-Subject: [RHEL-7.2 qemu-kvm PATCH 1/6] block/ssh: Drop superfluous libssh2_session_last_errno() calls
05bba0
Bugzilla: 1226683
05bba0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
05bba0
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
05bba0
05bba0
From: Markus Armbruster <armbru@redhat.com>
05bba0
05bba0
libssh2_session_last_error() already returns the error code.
05bba0
05bba0
Signed-off-by: Markus Armbruster <armbru@redhat.com>
05bba0
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
05bba0
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
05bba0
05bba0
Upstream-status: 04bc7c0e38fc77afc116031f1e25af80374b1971
05bba0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
---
05bba0
 block/ssh.c | 9 ++++-----
05bba0
 1 file changed, 4 insertions(+), 5 deletions(-)
05bba0
05bba0
diff --git a/block/ssh.c b/block/ssh.c
05bba0
index fa3c78d..1f7c6ed 100644
05bba0
--- a/block/ssh.c
05bba0
+++ b/block/ssh.c
05bba0
@@ -121,10 +121,9 @@ session_error_report(BDRVSSHState *s, const char *fs, ...)
05bba0
         char *ssh_err;
05bba0
         int ssh_err_code;
05bba0
 
05bba0
-        libssh2_session_last_error((s)->session, &ssh_err, NULL, 0);
05bba0
         /* This is not an errno.  See <libssh2.h>. */
05bba0
-        ssh_err_code = libssh2_session_last_errno((s)->session);
05bba0
-
05bba0
+        ssh_err_code = libssh2_session_last_error(s->session,
05bba0
+                                                  &ssh_err, NULL, 0);
05bba0
         error_printf(": %s (libssh2 error code: %d)", ssh_err, ssh_err_code);
05bba0
     }
05bba0
 
05bba0
@@ -145,9 +144,9 @@ sftp_error_report(BDRVSSHState *s, const char *fs, ...)
05bba0
         int ssh_err_code;
05bba0
         unsigned long sftp_err_code;
05bba0
 
05bba0
-        libssh2_session_last_error((s)->session, &ssh_err, NULL, 0);
05bba0
         /* This is not an errno.  See <libssh2.h>. */
05bba0
-        ssh_err_code = libssh2_session_last_errno((s)->session);
05bba0
+        ssh_err_code = libssh2_session_last_error(s->session,
05bba0
+                                                  &ssh_err, NULL, 0);
05bba0
         /* See <libssh2_sftp.h>. */
05bba0
         sftp_err_code = libssh2_sftp_last_error((s)->sftp);
05bba0
 
05bba0
-- 
05bba0
1.8.3.1
05bba0