diff options
author | 2018-09-06 19:19:39 +0800 | |
---|---|---|
committer | 2018-09-12 10:37:30 +0800 | |
commit | c0817e0ba61968f842f4f8d5fbb30d5c93be8dec (patch) | |
tree | abde83aff34216bfe4d8e2969dd728b26ce106ee /net-analyzer/openbsd-netcat/files | |
parent | www-client/chromium: dev channel bump (70.0.3538.9) (diff) | |
download | gentoo-c0817e0ba61968f842f4f8d5fbb30d5c93be8dec.tar.gz gentoo-c0817e0ba61968f842f4f8d5fbb30d5c93be8dec.tar.bz2 gentoo-c0817e0ba61968f842f4f8d5fbb30d5c93be8dec.zip |
net-analyzer/openbsd-netcat: bump to version 1.190
Bump to EAPI 7 (deprecate epatch)
Use debian/patches/series to determine patch order
Remove eapi-deprecated ebuild
Closes: https://github.com/gentoo/gentoo/pull/9790
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'net-analyzer/openbsd-netcat/files')
-rw-r--r-- | net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch | 90 |
1 files changed, 90 insertions, 0 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 new file mode 100644 index 000000000000..818b13a81a59 --- /dev/null +++ b/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch @@ -0,0 +1,90 @@ +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,13 @@ + # 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 */ + +@@ -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" + +@@ -240,6 +243,43 @@ static int connect_with_timeout(int fd, const struct sockaddr *sa, + + static void quit(); + ++static char* strtonumerrs[] = { ++ "too large", ++ "too small", ++ "invalid" ++}; ++ ++static long long ++strtonum( ++ const char *nptr, ++ long long minval, ++ long long maxval, ++ const char **errstr) ++{ ++ long long val; ++ ++ while (*nptr != '\0' && isspace(*nptr)) ++ nptr++; ++ if (*nptr == '\0') { ++ if (errstr != NULL) ++ *errstr = strtonumerrs[2]; ++ return 0; ++ } ++ val = atoll(nptr); ++ if (val < minval) { ++ if (errstr != NULL) ++ *errstr = strtonumerrs[1]; ++ return 0; ++ } ++ if (val > maxval) { ++ if (errstr != NULL) ++ *errstr = strtonumerrs[0]; ++ return 0; ++ } ++ *errstr = NULL; ++ return val; ++} ++ + int + main(int argc, char *argv[]) + { +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" |