freebsd-ports/security/arirang/files/patch-proxy.c
Mikhail Teterin af331e2341 Unbreak arirang -- it needs to use the newer Ruby API, which, at the
time the last release was made, was still known as RUBY_19.

While here, fix an ancient bug reported by clang.
2015-03-23 13:52:35 +00:00

24 lines
604 B
C

Do not attempt to close the sock we never opened. Use herror() to report
a DNS-failure, not perror().
-mi
--- proxy.c 2011-05-17 22:19:11.000000000 -0400
+++ proxy.c 2015-03-23 09:46:34.000000000 -0400
@@ -94,15 +94,13 @@
struct hostent *he;
if ((he = gethostbyname(proxyhost)) == NULL) {
- perror("proxy host not found");
- close(sock);
+ herror("proxy host not found");
exit(0);
}
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
- close(sock);
exit(0);
}
http.sin_family = AF_INET;