Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jan 2019 03:43:12 +0000 (UTC)
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343461 - head/lib/libc/tests/sys
Message-ID:  <201901260343.x0Q3hCje034889@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat Jan 26 03:43:12 2019
New Revision: 343461
URL: https://svnweb.freebsd.org/changeset/base/343461

Log:
  Fix reporting errors with `gai_strerror(..)`
  
  The return value (`err`) should be checked; not the `errno` value.
  
  PR:		235200
  Approved by:	emaste (mentor)
  Reviewed by:	asomers, lwhsu
  MFC after:	28 days
  MFC with:	r343362, r343365, r343367-r343368
  Differential Revision: https://reviews.freebsd.org/D18969

Modified:
  head/lib/libc/tests/sys/sendfile_test.c

Modified: head/lib/libc/tests/sys/sendfile_test.c
==============================================================================
--- head/lib/libc/tests/sys/sendfile_test.c	Fri Jan 25 22:52:49 2019	(r343460)
+++ head/lib/libc/tests/sys/sendfile_test.c	Sat Jan 26 03:43:12 2019	(r343461)
@@ -114,7 +114,7 @@ resolve_localhost(struct addrinfo **res, int domain, i
 
 	error = getaddrinfo("localhost", serv, &hints, res);
 	ATF_REQUIRE_EQ_MSG(error, 0,
-	    "getaddrinfo failed: %s", gai_strerror(errno));
+	    "getaddrinfo failed: %s", gai_strerror(error));
 	free(serv);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901260343.x0Q3hCje034889>