svn commit: r357375 - head/tests/sys/net

Kristof Provost kp at FreeBSD.org
Sat Feb 1 19:40:12 UTC 2020


Author: kp
Date: Sat Feb  1 19:40:11 2020
New Revision: 357375
URL: https://svnweb.freebsd.org/changeset/base/357375

Log:
  tests: epair: Don't fail if we load if_epair
  
  kldload() returns a positive integer when it loads a ko, so check that the
  return value is -1 to detect error cases, not that it's different from zero.
  
  MFC after:	3 days
  X-MFC-With:	r357234

Modified:
  head/tests/sys/net/if_epair.c

Modified: head/tests/sys/net/if_epair.c
==============================================================================
--- head/tests/sys/net/if_epair.c	Sat Feb  1 18:23:51 2020	(r357374)
+++ head/tests/sys/net/if_epair.c	Sat Feb  1 19:40:11 2020	(r357375)
@@ -53,7 +53,7 @@ ATF_TC_BODY(params, tc)
 	int s;
 
 	s = kldload("if_epair");
-	if (s != 0 && errno != EEXIST)
+	if (s == -1 && errno != EEXIST)
 		atf_tc_fail("Failed to load if_epair");
 
 	s = socket(AF_INET, SOCK_DGRAM, 0);


More information about the svn-src-head mailing list