diff options
author | joerg <joerg> | 2008-02-07 17:47:12 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-02-07 17:47:12 +0000 |
commit | 6dc8696cd589ed45c5649414cb05d7f9d315c1c5 (patch) | |
tree | 12032ac8c016a6751c64edb5010be142d2b3cd33 /net/libfetch | |
parent | 87278a6dd43117c34b585252d6f5be5d49f0f96e (diff) | |
download | pkgsrc-6dc8696cd589ed45c5649414cb05d7f9d315c1c5.tar.gz |
Don't use warnx, fprintf(stderr, ...) is good enough. Rename logname to
login_name to avoid shadowing a global variable.
Diffstat (limited to 'net/libfetch')
-rw-r--r-- | net/libfetch/files/ftp.c | 13 | ||||
-rw-r--r-- | net/libfetch/files/http.c | 7 |
2 files changed, 9 insertions, 11 deletions
diff --git a/net/libfetch/files/ftp.c b/net/libfetch/files/ftp.c index fac0b372f87..2a3d077ed1f 100644 --- a/net/libfetch/files/ftp.c +++ b/net/libfetch/files/ftp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.7 2008/02/07 17:42:14 joerg Exp $ */ +/* $NetBSD: ftp.c,v 1.8 2008/02/07 17:47:12 joerg Exp $ */ /*- * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav * All rights reserved. @@ -61,7 +61,6 @@ #include <netinet/in.h> #include <ctype.h> -#include <err.h> #include <errno.h> #include <fcntl.h> #include <netdb.h> @@ -908,7 +907,7 @@ ouch: static int ftp_authenticate(conn_t *conn, struct url *url, struct url *purl) { - const char *user, *pwd, *logname; + const char *user, *pwd, *login_name; char pbuf[URL_USERLEN + 1 + URL_HOSTLEN + 1]; int e, len; @@ -935,9 +934,9 @@ ftp_authenticate(conn_t *conn, struct url *url, struct url *purl) if (*pwd == '\0') pwd = getenv("FTP_PASSWORD"); if (pwd == NULL || *pwd == '\0') { - if ((logname = getlogin()) == 0) - logname = FTP_ANONYMOUS_USER; - if ((len = snprintf(pbuf, URL_USERLEN + 2, "%s@", logname)) < 0) + if ((login_name = getlogin()) == 0) + login_name = FTP_ANONYMOUS_USER; + if ((len = snprintf(pbuf, URL_USERLEN + 2, "%s@", login_name)) < 0) len = 0; else if (len > URL_USERLEN + 1) len = URL_USERLEN + 1; @@ -1202,6 +1201,6 @@ fetchStatFTP(struct url *url, struct url_stat *us, const char *flags) struct url_ent * fetchListFTP(struct url *url, const char *flags) { - warnx("fetchListFTP(): not implemented"); + fprintf(stderr, "fetchListFTP(): not implemented\n"); return (NULL); } diff --git a/net/libfetch/files/http.c b/net/libfetch/files/http.c index bb9f5e07b82..064bf0d05df 100644 --- a/net/libfetch/files/http.c +++ b/net/libfetch/files/http.c @@ -1,4 +1,4 @@ -/* $NetBSD: http.c,v 1.6 2008/02/07 17:27:40 joerg Exp $ */ +/* $NetBSD: http.c,v 1.7 2008/02/07 17:47:12 joerg Exp $ */ /*- * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav * All rights reserved. @@ -65,7 +65,6 @@ #include <sys/socket.h> #include <ctype.h> -#include <err.h> #include <errno.h> #include <locale.h> #include <netdb.h> @@ -1201,7 +1200,7 @@ fetchGetHTTP(struct url *URL, const char *flags) FILE * fetchPutHTTP(struct url *URL, const char *flags) { - warnx("fetchPutHTTP(): not implemented"); + fprintf(stderr, "fetchPutHTTP(): not implemented\n"); return (NULL); } @@ -1226,6 +1225,6 @@ fetchStatHTTP(struct url *URL, struct url_stat *us, const char *flags) struct url_ent * fetchListHTTP(struct url *url, const char *flags) { - warnx("fetchListHTTP(): not implemented"); + fprintf(stderr, "fetchListHTTP(): not implemented\n"); return (NULL); } |