From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Privoznik Subject: Re: [libvirt] [PATCH V2] libxl: don't overwrite error from virNetSocketNewConnectTCP() Date: Fri, 4 Sep 2015 10:21:59 +0200 Message-ID: <55E954A7.8080004@redhat.com> References: <1441302033-20508-1-git-send-email-jfehlig@suse.com> <55E8B3DF.4040605@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55E8B3DF.4040605@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: John Ferlan , Jim Fehlig , libvir-list@redhat.com Cc: ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 03.09.2015 22:55, John Ferlan wrote: > > > On 09/03/2015 01:40 PM, Jim Fehlig wrote: >> Remove redundant error reporting in libxlDomainMigrationPerform(). >> virNetSocketNewConnectTCP() is perfectly capable of reporting >> sensible errors. >> >> Signed-off-by: Jim Fehlig >> --- >> >> V2: >> Actually try to compile the code and find saved_errno is no >> longer used - remove it. >> >> src/libxl/libxl_migration.c | 7 +------ >> 1 file changed, 1 insertion(+), 6 deletions(-) >> > > ACK > > John > > Also noteworthy that virNetSocketNewConnectTCP could overwrite errno > when freeaddrinfo is run in error: or when VIR_FORCE_CLOSE() did it's > thing... > I don't think that either of those overwrites errno. Here's freeaddrinfo() impl that I've found in glibc: void freeaddrinfo (struct addrinfo *ai) { struct addrinfo *p; while (ai != NULL) { p = ai; ai = ai->ai_next; free (p->ai_canonname); free (p); } } And VIR_FORCE_CLOSE() preserves errno too. But nevertheless, ACK stands. Michal