summaryrefslogtreecommitdiff
path: root/src/usr.bin
diff options
context:
space:
mode:
authoraaron <>2002-12-13 19:53:45 +0000
committeraaron <>2002-12-13 19:53:45 +0000
commit85b3ca05f10b2eadc75b8dc8376fc893c490d60f (patch)
treedee76c62bf228c01deda38c4935c79eb99ede4ab /src/usr.bin
parent3aa45ad8adef31b662a315f8bb0a3bb881e8c7ed (diff)
downloadopenbsd-85b3ca05f10b2eadc75b8dc8376fc893c490d60f.tar.gz
openbsd-85b3ca05f10b2eadc75b8dc8376fc893c490d60f.tar.bz2
openbsd-85b3ca05f10b2eadc75b8dc8376fc893c490d60f.zip
Recent modifications to netcat changed the behaviour to only exit when both
the read (network) and write (stdin) ends of the socket were both closed. This is not how nc traditionally works. Instead, revert back to finishing up when read() on the socket returns 0; deraadt@, vincent@ ok.
Diffstat (limited to 'src/usr.bin')
-rw-r--r--src/usr.bin/nc/netcat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c
index 23d0ed4468..717e0377eb 100644
--- a/src/usr.bin/nc/netcat.c
+++ b/src/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: netcat.c,v 1.53 2002/11/13 22:26:15 markus Exp $ */ 1/* $OpenBSD: netcat.c,v 1.54 2002/12/13 19:53:45 aaron Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> 3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
4 * 4 *
@@ -546,7 +546,7 @@ readwrite(int nfd)
546 pfd[1].fd = wfd; 546 pfd[1].fd = wfd;
547 pfd[1].events = POLLIN; 547 pfd[1].events = POLLIN;
548 548
549 while (pfd[0].fd != -1 || pfd[1].fd != -1) { 549 while (pfd[0].fd != -1) {
550 if (iflag) 550 if (iflag)
551 sleep(iflag); 551 sleep(iflag);
552 552