diff options
| author | Colin Percival <cperciva@FreeBSD.org> | 2009-04-03 21:13:18 +0000 |
|---|---|---|
| committer | Colin Percival <cperciva@FreeBSD.org> | 2009-04-03 21:13:18 +0000 |
| commit | 04419f3b80444047c4c1eb89f75e9eadc43b9ee4 (patch) | |
| tree | c7f9098155be58bb1283adcf6539492c20295e99 | |
| parent | bafb92643e68f49096755c67fef6fda735b17862 (diff) | |
Notes
| -rw-r--r-- | usr.sbin/portsnap/phttpget/phttpget.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/portsnap/phttpget/phttpget.c b/usr.sbin/portsnap/phttpget/phttpget.c index e10912493a21..1bf6d9d5b153 100644 --- a/usr.sbin/portsnap/phttpget/phttpget.c +++ b/usr.sbin/portsnap/phttpget/phttpget.c @@ -317,6 +317,7 @@ main(int argc, char *argv[]) int chunked; /* != if transfer-encoding is chunked */ off_t clen; /* Chunk length */ int firstreq = 0; /* # of first request for this connection */ + int val; /* Value used for setsockopt call */ /* Check that the arguments are sensible */ if (argc < 2) @@ -370,6 +371,11 @@ main(int argc, char *argv[]) setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, (void *)&timo, (socklen_t)sizeof(timo)); + /* ... disable SIGPIPE generation ... */ + val = 1; + setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, + (void *)&val, sizeof(int)); + /* ... and connect to the server. */ if(connect(sd, res->ai_addr, res->ai_addrlen)) { close(sd); |
