Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Staging:C
netcat-openbsd
pollhup.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pollhup.patch of Package netcat-openbsd
Index: netcat-openbsd-1.89/netcat.c =================================================================== --- netcat-openbsd-1.89.orig/netcat.c 2008-01-22 16:17:18.000000000 -0500 +++ netcat-openbsd-1.89/netcat.c 2008-01-22 16:17:25.000000000 -0500 @@ -618,9 +618,7 @@ 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); @@ -628,18 +626,30 @@ 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; + } } } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor