summaryrefslogtreecommitdiff
path: root/regress/lib/libc_r/socket/2a/socket2a.c
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-01-02 16:15:33 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-01-02 16:15:33 +0000
commitacd2cb62699f195aed19fd71a8032746058b050e (patch)
tree95a4670dc56a3733a0ade2ffafc45687084a2f83 /regress/lib/libc_r/socket/2a/socket2a.c
parent5afe04755bfb973fdd672196974289750b0a63c9 (diff)
Be sure both programs are using the same port.
Diffstat (limited to 'regress/lib/libc_r/socket/2a/socket2a.c')
-rw-r--r--regress/lib/libc_r/socket/2a/socket2a.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regress/lib/libc_r/socket/2a/socket2a.c b/regress/lib/libc_r/socket/2a/socket2a.c
index 96278cd981c..67b8a07c4fb 100644
--- a/regress/lib/libc_r/socket/2a/socket2a.c
+++ b/regress/lib/libc_r/socket/2a/socket2a.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: socket2a.c,v 1.2 2001/09/20 16:43:16 todd Exp $ */
+/* $OpenBSD: socket2a.c,v 1.3 2002/01/02 16:15:32 fgsch Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors,
* proven@mit.edu All rights reserved.
@@ -65,7 +65,7 @@ sock_connect(arg)
int fd;
short port;
- port = 3276;
+ port = atoi(arg);
a_sout.sin_family = AF_INET;
a_sout.sin_port = htons(port);
a_sout.sin_addr.s_addr = htonl(INADDR_LOOPBACK); /* loopback */
@@ -101,13 +101,13 @@ main(argc, argv)
{
pthread_t thread;
- if (argv[1] && (!strcmp(argv[1], "fork okay"))) {
+ if (argc == 3 && (!strcmp(argv[1], "fork okay"))) {
sleep(1);
setbuf(stdout, NULL);
setbuf(stderr, NULL);
CHECKr(pthread_create(&thread, NULL, sock_connect,
- (void *)0xdeadbeaf));
+ (void *)argv[2]));
CHECKr(pthread_join(thread, NULL));
SUCCEED;
} else {