Fix some lint warnings about G/C unused variables and changing a
variable type to match the return type of fetch_read.
This commit is contained in:
parent
02b92a4440
commit
1bec197458
2 changed files with 6 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue