torrentd

simple torrent daemon
git clone git@git.2f30.org/torrentd.git
Log | Files | Refs | LICENSE

commit fc3e8e817690a314b37ca5f9af4a7b8006a693ea
parent d1e91a3f8e8a4dab8a6f09762aeff507664a1f47
Author: sin <sin@2f30.org>
Date:   Thu, 17 Dec 2015 16:53:38 +0000

Style fix

Diffstat:
Msock.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sock.c b/sock.c @@ -27,7 +27,7 @@ int dial(char *host, char *port) { struct addrinfo hints, *res, *r; - int sock; + int s; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; @@ -35,15 +35,15 @@ dial(char *host, char *port) if (getaddrinfo(host, port, &hints, &res)) errx(1, "can't resolve %s", host); for (r = res; r; r = r->ai_next) { - sock = socket(r->ai_family, r->ai_socktype, 0); - if (sock < 0) + s = socket(r->ai_family, r->ai_socktype, 0); + if (s < 0) continue; - if (!connect(sock, r->ai_addr, r->ai_addrlen)) + if (!connect(s, r->ai_addr, r->ai_addrlen)) break; - close(sock); + close(s); } freeaddrinfo(res); if (!r) errx(1, "cannot connect to %s", host); - return sock; + return s; }