pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/libfetch/files Don't use warnx, fprintf(stderr, .....



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2b599b28b4db
branches:  trunk
changeset: 538407:2b599b28b4db
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Feb 07 17:47:12 2008 +0000

description:
Don't use warnx, fprintf(stderr, ...) is good enough. Rename logname to
login_name to avoid shadowing a global variable.

diffstat:

 net/libfetch/files/ftp.c  |  13 ++++++-------
 net/libfetch/files/http.c |   7 +++----
 2 files changed, 9 insertions(+), 11 deletions(-)

diffs (81 lines):

diff -r 951142fe0c30 -r 2b599b28b4db net/libfetch/files/ftp.c
--- a/net/libfetch/files/ftp.c  Thu Feb 07 17:42:14 2008 +0000
+++ b/net/libfetch/files/ftp.c  Thu Feb 07 17:47:12 2008 +0000
@@ -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 @@
 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 @@
                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 @@
 struct url_ent *
 fetchListFTP(struct url *url, const char *flags)
 {
-       warnx("fetchListFTP(): not implemented");
+       fprintf(stderr, "fetchListFTP(): not implemented\n");
        return (NULL);
 }
diff -r 951142fe0c30 -r 2b599b28b4db net/libfetch/files/http.c
--- a/net/libfetch/files/http.c Thu Feb 07 17:42:14 2008 +0000
+++ b/net/libfetch/files/http.c Thu Feb 07 17:47:12 2008 +0000
@@ -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 @@
 FILE *
 fetchPutHTTP(struct url *URL, const char *flags)
 {
-       warnx("fetchPutHTTP(): not implemented");
+       fprintf(stderr, "fetchPutHTTP(): not implemented\n");
        return (NULL);
 }
 
@@ -1226,6 +1225,6 @@
 struct url_ent *
 fetchListHTTP(struct url *url, const char *flags)
 {
-       warnx("fetchListHTTP(): not implemented");
+       fprintf(stderr, "fetchListHTTP(): not implemented\n");
        return (NULL);
 }



Home | Main Index | Thread Index | Old Index