From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlELt-0001bV-4k for qemu-devel@nongnu.org; Fri, 16 May 2014 05:22:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlELn-0004tJ-0O for qemu-devel@nongnu.org; Fri, 16 May 2014 05:22:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlELm-0004rr-NY for qemu-devel@nongnu.org; Fri, 16 May 2014 05:22:46 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4G9MjiD022456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 16 May 2014 05:22:46 -0400 From: Markus Armbruster Date: Fri, 16 May 2014 11:00:12 +0200 Message-Id: <1400230826-18009-6-git-send-email-armbru@redhat.com> In-Reply-To: <1400230826-18009-1-git-send-email-armbru@redhat.com> References: <1400230826-18009-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 05/19] block/ssh: Drop superfluous libssh2_session_last_errno() calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com libssh2_session_last_error() already returns the error code. Signed-off-by: Markus Armbruster Reviewed-by: Richard W.M. Jones --- block/ssh.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index aa63c9d..e38d232 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -121,10 +121,9 @@ session_error_report(BDRVSSHState *s, const char *fs, ...) char *ssh_err; int ssh_err_code; - libssh2_session_last_error((s)->session, &ssh_err, NULL, 0); /* This is not an errno. See . */ - 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); } @@ -145,9 +144,9 @@ sftp_error_report(BDRVSSHState *s, const char *fs, ...) int ssh_err_code; unsigned long sftp_err_code; - libssh2_session_last_error((s)->session, &ssh_err, NULL, 0); /* This is not an errno. See . */ - ssh_err_code = libssh2_session_last_errno((s)->session); + ssh_err_code = libssh2_session_last_error(s->session, + &ssh_err, NULL, 0); /* See . */ sftp_err_code = libssh2_sftp_last_error((s)->sftp); -- 1.8.1.4