Skip to content

Commit

Permalink
signals already configured by posix
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Dec 26, 2023
1 parent b6d8f8b commit b8a08ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/platform/posix/posix_socketpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ nni_socket_pair(int *fds)
return (nni_plat_errno(errno));

Check warning on line 26 in src/platform/posix/posix_socketpair.c

View check run for this annotation

Codecov / codecov/patch

src/platform/posix/posix_socketpair.c#L26

Added line #L26 was not covered by tests
}

#ifdef SO_NOSIGPIPE
int set = 1;
setsockopt(fds[0], SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int));
setsockopt(fds[1], SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int));
#endif

return (0);
}
#else
Expand Down
4 changes: 1 addition & 3 deletions src/sp/transport/fdconn/fdc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ test_fdc_accept(void)

NUTS_PASS(nng_socket_pair(fds));
// make sure we won't have to deal with SIGPIPE - EPIPE is better
signal(SIGPIPE, SIG_IGN);
NUTS_OPEN(s1);
NUTS_OPEN(s2);
NUTS_PASS(nng_listener_create(&l, s1, "fdconn://"));
Expand All @@ -72,8 +71,6 @@ test_fdc_exchange(void)
int fds[2];

NUTS_PASS(nng_socket_pair(fds));
// make sure we won't have to deal with SIGPIPE - EPIPE is better
signal(SIGPIPE, SIG_IGN);
NUTS_OPEN(s1);
NUTS_OPEN(s2);
NUTS_PASS(nng_listener_create(&l1, s1, "fdconn://"));
Expand Down Expand Up @@ -105,6 +102,7 @@ test_fdc_recv_max(void)
size_t sz;
int fds[2];


NUTS_PASS(nng_socket_pair(fds));

NUTS_OPEN(s0);
Expand Down

0 comments on commit b8a08ce

Please sign in to comment.