Author: kp
Date: Sat Feb  1 11:31:45 2020
New Revision: 357365
URL: https://svnweb.freebsd.org/changeset/base/357365

Log:
  tests: epair: Don't fail if the if_epair module is already loaded
  
  kldload() returns an error (EEXIST) if the module is already loaded.
  That's not a problem for us, so ignore that error.
  
  While here also clean up include statements.
  
  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 10:25:13 2020        
(r357364)
+++ head/tests/sys/net/if_epair.c       Sat Feb  1 11:31:45 2020        
(r357365)
@@ -25,17 +25,19 @@
  * $FreeBSD$
  */
 
+#include <sys/param.h>
 #include <sys/ioctl.h>
 #include <sys/linker.h>
 #include <sys/module.h>
-#include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 
 #include <net/if.h>
 
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <strings.h>
 
 #include <atf-c.h>
 
@@ -51,7 +53,7 @@ ATF_TC_BODY(params, tc)
        int s;
 
        s = kldload("if_epair");
-       if (s != 0)
+       if (s != 0 && errno != EEXIST)
                atf_tc_fail("Failed to load if_epair");
 
        s = socket(AF_INET, SOCK_DGRAM, 0);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to