Skip to content

Commit

Permalink
Update tests/testlib/s2n_connection_test_utils.c
Browse files Browse the repository at this point in the history
Co-authored-by: Lindsay Stewart <stewart.r.lindsay@gmail.com>
  • Loading branch information
boquan-fang and lrstewart authored Oct 10, 2024
1 parent b9e61fe commit 333d34f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/testlib/s2n_connection_test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,15 @@ int s2n_connections_set_io_pair(struct s2n_connection *client, struct s2n_connec

int s2n_io_pair_close(struct s2n_test_io_pair *io_pair)
{
if (fcntl(io_pair->client, F_GETFD) != -1 || errno != EBADF) {
POSIX_GUARD(s2n_io_pair_close_one_end(io_pair, S2N_CLIENT));
}
if (fcntl(io_pair->server, F_GETFD) != -1 || errno != EBADF) {
POSIX_GUARD(s2n_io_pair_close_one_end(io_pair, S2N_SERVER));
}
int client_result = s2n_io_pair_close_one_end(io_pair, S2N_CLIENT);
int client_s2n_errno = s2n_errno;
int client_errno = errno;

POSIX_GUARD(s2n_io_pair_close_one_end(io_pair, S2N_SERVER));

s2n_errno = client_s2n_errno;
errno = client_errno;
POSIX_GUARD(client_result);
return 0;
}

Expand Down

0 comments on commit 333d34f

Please sign in to comment.