Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Reapply some portability patches to libfetch that were dropped by accident
Baptiste Daroussin committed 6 years ago
commit 12de6d9c70b4d5d68459a22a8b42b6aac98a4d82
parent de9a030
1 file changed +4 -0
modified external/libfetch/common.c
@@ -221,13 +221,17 @@ conn_t *
fetch_reopen(int sd)
{
	conn_t *conn;
+
#ifdef SO_NOSIGPIPE
	int opt = 1;
+
#endif

	/* allocate and fill connection structure */
	if ((conn = calloc(1, sizeof(*conn))) == NULL)
		return (NULL);
	fcntl(sd, F_SETFD, FD_CLOEXEC);
+
#ifdef SO_NOSIGPIPE
	setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof opt);
+
#endif
	conn->sd = sd;
	++conn->ref;
	return (conn);