diff options
author | joerg <joerg> | 2009-08-11 20:48:06 +0000 |
---|---|---|
committer | joerg <joerg> | 2009-08-11 20:48:06 +0000 |
commit | 7d350720c3bcbaf9efc52a0150e3b1f6056b3e19 (patch) | |
tree | 47f2c5d53e0ce0478142478a5a3280ac577e291e /net | |
parent | 404cbd0f4767165b9cc18c5bd229ba85a8738b85 (diff) | |
download | pkgsrc-7d350720c3bcbaf9efc52a0150e3b1f6056b3e19.tar.gz |
Fix some lint warnings about G/C unused variables and changing a
variable type to match the return type of fetch_read.
Diffstat (limited to 'net')
-rw-r--r-- | net/libfetch/files/common.c | 10 | ||||
-rw-r--r-- | net/libfetch/files/fetch.c | 10 |
2 files changed, 6 insertions, 14 deletions
diff --git a/net/libfetch/files/common.c b/net/libfetch/files/common.c index bd21e88003e..c9a55ee4119 100644 --- a/net/libfetch/files/common.c +++ b/net/libfetch/files/common.c @@ -1,4 +1,4 @@ -/* $NetBSD: common.c,v 1.18 2009/02/22 19:11:48 joerg Exp $ */ +/* $NetBSD: common.c,v 1.19 2009/08/11 20:48:06 joerg Exp $ */ /*- * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org> @@ -261,17 +261,17 @@ int fetch_bind(int sd, int af, const char *addr) { struct addrinfo hints, *res, *res0; - int error; memset(&hints, 0, sizeof(hints)); hints.ai_family = af; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; - if ((error = getaddrinfo(addr, NULL, &hints, &res0)) != 0) + if (getaddrinfo(addr, NULL, &hints, &res0)) return (-1); - for (res = res0; res; res = res->ai_next) + for (res = res0; res; res = res->ai_next) { if (bind(sd, res->ai_addr, res->ai_addrlen) == 0) return (0); + } return (-1); } @@ -614,7 +614,7 @@ int fetch_putln(conn_t *conn, const char *str, size_t len) { struct iovec iov[2]; - int ret; + ssize_t ret; iov[0].iov_base = DECONST(char *, str); iov[0].iov_len = len; diff --git a/net/libfetch/files/fetch.c b/net/libfetch/files/fetch.c index 6339e73337a..c287097a02a 100644 --- a/net/libfetch/files/fetch.c +++ b/net/libfetch/files/fetch.c @@ -1,4 +1,4 @@ -/* $NetBSD: fetch.c,v 1.18 2009/02/05 23:29:14 joerg Exp $ */ +/* $NetBSD: fetch.c,v 1.19 2009/08/11 20:48:06 joerg Exp $ */ /*- * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org> @@ -80,9 +80,7 @@ static struct fetcherr url_errlist[] = { fetchIO * fetchXGet(struct url *URL, struct url_stat *us, const char *flags) { - int direct; - direct = CHECK_FLAG('d'); if (us != NULL) { us->size = -1; us->atime = us->mtime = 0; @@ -116,9 +114,7 @@ fetchGet(struct url *URL, const char *flags) fetchIO * fetchPut(struct url *URL, const char *flags) { - int direct; - direct = CHECK_FLAG('d'); if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) return (fetchPutFile(URL, flags)); else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) @@ -138,9 +134,7 @@ fetchPut(struct url *URL, const char *flags) int fetchStat(struct url *URL, struct url_stat *us, const char *flags) { - int direct; - direct = CHECK_FLAG('d'); if (us != NULL) { us->size = -1; us->atime = us->mtime = 0; @@ -165,9 +159,7 @@ int fetchList(struct url_list *ue, struct url *URL, const char *pattern, const char *flags) { - int direct; - direct = CHECK_FLAG('d'); if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) return (fetchListFile(ue, URL, pattern, flags)); else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) |