Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/net don't open the socket twice.



details:   https://anonhg.NetBSD.org/src/rev/8c9f6e12c960
branches:  trunk
changeset: 935603:8c9f6e12c960
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 06 16:24:06 2020 +0000

description:
don't open the socket twice.

diffstat:

 tests/net/net/t_unix.c |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (37 lines):

diff -r 3d28e74e7ba1 -r 8c9f6e12c960 tests/net/net/t_unix.c
--- a/tests/net/net/t_unix.c    Mon Jul 06 13:20:55 2020 +0000
+++ b/tests/net/net/t_unix.c    Mon Jul 06 16:24:06 2020 +0000
@@ -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 @@
        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);



Home | Main Index | Thread Index | Old Index