diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-01-02 16:15:33 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-01-02 16:15:33 +0000 |
commit | acd2cb62699f195aed19fd71a8032746058b050e (patch) | |
tree | 95a4670dc56a3733a0ade2ffafc45687084a2f83 /regress/lib/libc_r/socket/2a/socket2a.c | |
parent | 5afe04755bfb973fdd672196974289750b0a63c9 (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.c | 8 |
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 { |