* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/openbsd-netcat/files/
@ 2018-12-06 10:33 Fabian Groffen
0 siblings, 0 replies; 2+ messages in thread
From: Fabian Groffen @ 2018-12-06 10:33 UTC (permalink / raw
To: gentoo-commits
commit: ecaa995bf0658be5b8295624d14cc023b3c09e58
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 6 10:33:27 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec 6 10:33:42 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ecaa995b
net-analyzer/openbsd-netcat: complete Darwin patch to fix compilation
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
.../files/openbsd-netcat-1.190-darwin.patch | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch b/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch
index 818b13a81a5..e1a462e746b 100644
--- a/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch
+++ b/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch
@@ -75,6 +75,53 @@ index a0fb51b..bbb5dd1 100644
int
main(int argc, char *argv[])
{
+@@ -814,9 +814,8 @@
+ # endif
+ } else {
+ len = sizeof(cliaddr);
+- connfd = accept4(s, (struct sockaddr *)&cliaddr,
+- &len, SOCK_NONBLOCK);
+- if (connfd == -1) {
++ connfd = accept(s, (struct sockaddr *)&cliaddr, &len);
++ if (connfd == -1 || fcntl(connfd, F_SETFL, O_NONBLOCK) == -1) {
+ /* For now, all errnos are fatal */
+ err(1, "accept");
+ }
+@@ -1092,14 +1091,16 @@
+ int s, save_errno;
+
+ if (uflag) {
+- if ((s = unix_bind(unix_dg_tmp_socket, SOCK_CLOEXEC)) < 0)
++ if ((s = unix_bind(unix_dg_tmp_socket, 0)) < 0)
+ return -1;
+ } else {
+- if ((s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) < 0) {
++ if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
+ errx(1,"create unix socket failed");
+ return -1;
+ }
+ }
++ if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1)
++ return -1;
+
+ memset(&s_un, 0, sizeof(struct sockaddr_un));
+ s_un.sun_family = AF_UNIX;
+@@ -1174,9 +1175,13 @@
+ port, gai_strerror(error));
+
+ for (res = res0; res; res = res->ai_next) {
+- if ((s = socket(res->ai_family, res->ai_socktype |
+- SOCK_NONBLOCK, res->ai_protocol)) < 0)
++ if ((s = socket(res->ai_family, res->ai_socktype,
++ res->ai_protocol)) < 0)
++ continue;
++ if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) {
++ close(s);
+ continue;
++ }
+
+ /* Bind to a local port or source address if specified. */
+ if (sflag || pflag) {
diff --git a/socks.c b/socks.c
index 9068f39..68b68e3 100644
--- a/socks.c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/openbsd-netcat/files/
@ 2023-02-01 1:18 Conrad Kostecki
0 siblings, 0 replies; 2+ messages in thread
From: Conrad Kostecki @ 2023-02-01 1:18 UTC (permalink / raw
To: gentoo-commits
commit: 75744ca5cd171495eb53f1a2e58aa3df2405ea73
Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Sat Jan 21 11:37:32 2023 +0000
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Wed Feb 1 01:13:41 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75744ca5
net-analyzer/openbsd-netcat: remove unused patch
Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Closes: https://github.com/gentoo/gentoo/pull/29202
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
.../files/openbsd-netcat-1.190-darwin.patch | 86 ----------------------
1 file changed, 86 deletions(-)
diff --git a/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch b/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch
deleted file mode 100644
index 72a3fe8ed9f5..000000000000
--- a/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-Allow compilation on Darwin
-
-diff --git a/netcat.c b/netcat.c
-index a0fb51b..bbb5dd1 100644
---- a/netcat.c
-+++ b/netcat.c
-@@ -51,11 +51,16 @@
- # include <bsd/readpassphrase.h>
- #endif
-
-+#ifndef IPTOS_LOWCOST
-+# define IPTOS_LOWCOST 0x02
-+#endif
- #ifndef IPTOS_LOWDELAY
- # define IPTOS_LOWDELAY 0x10
- # define IPTOS_THROUGHPUT 0x08
- # define IPTOS_RELIABILITY 0x04
--# define IPTOS_LOWCOST 0x02
- # define IPTOS_MINCOST IPTOS_LOWCOST
- #endif /* IPTOS_LOWDELAY */
-+#ifndef SOCK_CLOEXEC
-+# define SOCK_CLOEXEC 0
-+#endif
-
-@@ -108,8 +110,9 @@
- # include <tls.h>
- #endif
- #include <unistd.h>
--#include <bsd/stdlib.h>
--#include <bsd/string.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <ctype.h>
-
- #include "atomicio.h"
-
-@@ -814,9 +814,8 @@
- # endif
- } else {
- len = sizeof(cliaddr);
-- connfd = accept4(s, (struct sockaddr *)&cliaddr,
-- &len, SOCK_NONBLOCK);
-- if (connfd == -1) {
-+ connfd = accept(s, (struct sockaddr *)&cliaddr, &len);
-+ if (connfd == -1 || fcntl(connfd, F_SETFL, O_NONBLOCK) == -1) {
- /* For now, all errnos are fatal */
- err(1, "accept");
- }
-@@ -1100,6 +1099,8 @@
- return -1;
- }
- }
-+ if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1)
-+ return -1;
-
- memset(&s_un, 0, sizeof(struct sockaddr_un));
- s_un.sun_family = AF_UNIX;
-@@ -1174,9 +1175,13 @@
- port, gai_strerror(error));
-
- for (res = res0; res; res = res->ai_next) {
-- if ((s = socket(res->ai_family, res->ai_socktype |
-- SOCK_NONBLOCK, res->ai_protocol)) < 0)
-+ if ((s = socket(res->ai_family, res->ai_socktype,
-+ res->ai_protocol)) < 0)
-+ continue;
-+ if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) {
-+ close(s);
- continue;
-+ }
-
- /* Bind to a local port or source address if specified. */
- if (sflag || pflag) {
-diff --git a/socks.c b/socks.c
-index 9068f39..68b68e3 100644
---- a/socks.c
-+++ b/socks.c
-@@ -38,7 +38,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <resolv.h>
--#include <bsd/readpassphrase.h>
-+#include <readpassphrase.h>
- #include "atomicio.h"
-
- #define SOCKS_PORT "1080"
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-01 1:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 1:18 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/openbsd-netcat/files/ Conrad Kostecki
-- strict thread matches above, loose matches on Subject: below --
2018-12-06 10:33 Fabian Groffen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox