diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2012-12-23 11:48:30 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-11-06 00:57:03 -0600 |
commit | b49d0a636b226866bf9a19bbea02d9714bcaef2c (patch) | |
tree | 8c0aad35e0335b20dd49ae1a1b71689c35381045 /network/netcat-openbsd/patches/0004-poll-hup.patch | |
parent | 36b9d2ef47a33d7cfb19879dca67f3250a4c2b4e (diff) |
network/netcat-openbsd: Updated for version 1.105 (from Debian).
Apply the patches locally and added a note
about this package being incompatible with nc from Slackware
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'network/netcat-openbsd/patches/0004-poll-hup.patch')
-rw-r--r-- | network/netcat-openbsd/patches/0004-poll-hup.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/network/netcat-openbsd/patches/0004-poll-hup.patch b/network/netcat-openbsd/patches/0004-poll-hup.patch new file mode 100644 index 0000000000..14923cbfa2 --- /dev/null +++ b/network/netcat-openbsd/patches/0004-poll-hup.patch @@ -0,0 +1,59 @@ +From: Aron Xu <aron@debian.org> +Date: Mon, 13 Feb 2012 15:08:33 +0800 +Subject: poll hup + +--- + netcat.c | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +diff --git a/netcat.c b/netcat.c +index d912544..fdaca44 100644 +--- a/netcat.c ++++ b/netcat.c +@@ -884,9 +884,7 @@ readwrite(int nfd) + if ((n = read(nfd, buf, plen)) < 0) + return; + else if (n == 0) { +- shutdown(nfd, SHUT_RD); +- pfd[0].fd = -1; +- pfd[0].events = 0; ++ goto shutdown_rd; + } else { + if (tflag) + atelnet(nfd, buf, n); +@@ -894,18 +892,30 @@ readwrite(int nfd) + return; + } + } ++ else if (pfd[0].revents & POLLHUP) { ++ shutdown_rd: ++ shutdown(nfd, SHUT_RD); ++ pfd[0].fd = -1; ++ pfd[0].events = 0; ++ } + +- if (!dflag && pfd[1].revents & POLLIN) { ++ if (!dflag) { ++ if(pfd[1].revents & POLLIN) { + if ((n = read(wfd, buf, plen)) < 0) + return; + else if (n == 0) { +- shutdown(nfd, SHUT_WR); +- pfd[1].fd = -1; +- pfd[1].events = 0; ++ goto shutdown_wr; + } else { + if (atomicio(vwrite, nfd, buf, n) != n) + return; + } ++ } ++ else if (pfd[1].revents & POLLHUP) { ++ shutdown_wr: ++ shutdown(nfd, SHUT_WR); ++ pfd[1].fd = -1; ++ pfd[1].events = 0; ++ } + } + } + } +-- |