In refactoring the test before committing, a pointer was passed instead

of a structure for the sockaddr_in.  Pass the pointer to connect()
instead of the pointer to the pointer.

Specify a port number to connect to.
This commit is contained in:
Robert Watson 2005-01-16 15:01:28 +00:00
parent e3ec673e97
commit 2d7142bf0d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140352

View File

@ -64,7 +64,7 @@ test(const char *context, struct sockaddr_in *sin)
errx(-1, "%s: socket(PF_INET, SOCK_DGRAM, 0): %s", context,
strerror(errno));
if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0)
if (connect(sock, (struct sockaddr *)sin, sizeof(*sin)) < 0)
errx(-1, "%s: connect(%s): %s", context,
inet_ntoa(sin->sin_addr), strerror(errno));
@ -85,7 +85,7 @@ main(int argc, __unused char *argv[])
sin.sin_len = sizeof(sin);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
sin.sin_port = 0;
sin.sin_port = htons(8080); /* Arbitrary */
/*
* First run the system call test outside of a jail.