diff options
author | joerg <joerg@pkgsrc.org> | 2009-08-11 20:48:06 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-08-11 20:48:06 +0000 |
commit | ee194064d672935e837464b697cc3deafdfe13ca (patch) | |
tree | 47f2c5d53e0ce0478142478a5a3280ac577e291e | |
parent | 677b633b73eef04e1892ce49b8f63d478568578c (diff) | |
download | pkgsrc-ee194064d672935e837464b697cc3deafdfe13ca.tar.gz |
Fix some lint warnings about G/C unused variables and changing a
variable type to match the return type of fetch_read.
-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) |