Module Name:    src
Committed By:   christos
Date:           Mon Jul  6 16:24:06 UTC 2020

Modified Files:
        src/tests/net/net: t_unix.c

Log Message:
don't open the socket twice.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/tests/net/net/t_unix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/net/t_unix.c
diff -u src/tests/net/net/t_unix.c:1.18 src/tests/net/net/t_unix.c:1.19
--- src/tests/net/net/t_unix.c:1.18	Sat Apr 13 21:45:30 2019
+++ src/tests/net/net/t_unix.c	Mon Jul  6 12:24:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_unix.c,v 1.18 2019/04/14 01:45:30 christos Exp $	*/
+/*	$NetBSD: t_unix.c,v 1.19 2020/07/06 16:24:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$Id: t_unix.c,v 1.18 2019/04/14 01:45:30 christos Exp $");
+__RCSID("$Id: t_unix.c,v 1.19 2020/07/06 16:24:06 christos Exp $");
 #else
 #define getprogname() argv[0]
 #endif
@@ -162,17 +162,13 @@ test(bool forkit, bool closeit, size_t l
 	srvrpid = clntpid = getpid();
 	srvr = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (srvr == -1)
-		FAIL("socket(srvrer)");
+		FAIL("socket(server)");
 
 	slen = len + OF + 1;
 	
 	if ((sun = calloc(1, slen)) == NULL)
 		FAIL("calloc");
 
-	srvr = socket(AF_UNIX, SOCK_STREAM, 0);
-	if (srvr == -1)
-		FAIL("socket");
-
 	memset(sun->sun_path, 'a', len);
 	sun->sun_path[len] = '\0';
 	(void)unlink(sun->sun_path);

Reply via email to