From patchwork Fri Mar 18 20:58:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 64096 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp195633lbc; Fri, 18 Mar 2016 14:01:04 -0700 (PDT) X-Received: by 10.141.2.198 with SMTP id e189mr26885750qhd.64.1458334864147; Fri, 18 Mar 2016 14:01:04 -0700 (PDT) Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id u128si13660944qhb.120.2016.03.18.14.01.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Mar 2016 14:01:04 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2IKw5JC002118; Fri, 18 Mar 2016 16:58:06 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u2IKw495018411 for ; Fri, 18 Mar 2016 16:58:04 -0400 Received: from colepc.redhat.com (ovpn-113-66.phx2.redhat.com [10.3.113.66]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2IKw3oC032310; Fri, 18 Mar 2016 16:58:04 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 18 Mar 2016 16:58:02 -0400 Message-Id: <141c027b8dec6c57c9952b4fa3ae2305f9beb81d.1458334555.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: virtnettlscontexttest: Use virGetLastErrorMessage() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com Use virGetLastErrorMessage() rather than open code it --- There's many more examples of this spread around the code; this patch is meant as an example for http://wiki.libvirt.org/page/BiteSizedTasks tests/virnettlscontexttest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index a3e24a3..d33b896 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -90,13 +90,12 @@ static int testTLSContextInit(const void *opaque) goto cleanup; } } else { - virErrorPtr err = virGetLastError(); if (!data->expectFail) { VIR_WARN("Unexpected failure %s against %s", data->cacrt, data->crt); goto cleanup; } - VIR_DEBUG("Got error %s", err ? err->message : ""); + VIR_DEBUG("Got error %s", virGetLastErrorMessage()); } ret = 0;