diff options
author | ache <ache@FreeBSD.org> | 1996-11-14 07:30:17 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-11-14 07:30:17 +0000 |
commit | e1ccbc2171919533ee83930fc66f522389b5062c (patch) | |
tree | 03bca1832518048a232bfe3be5e580d342a780a5 /usr.sbin/pkg_install | |
parent | c9c621c36ada7907b7040953fdf6356ad5a8725b (diff) | |
download | FreeBSD-src-e1ccbc2171919533ee83930fc66f522389b5062c.zip FreeBSD-src-e1ccbc2171919533ee83930fc66f522389b5062c.tar.gz |
Use new ftpGetURL interface, as result, report FTP error
via ftpErrString or net error via hstrerror(h_errno)
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/lib/file.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index 19a93ce..ea28c47 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: file.c,v 1.23 1996/08/01 12:13:20 jkh Exp $"; +static const char *rcsid = "$Id: file.c,v 1.24 1996/10/14 19:41:44 jkh Exp $"; #endif /* @@ -24,6 +24,7 @@ static const char *rcsid = "$Id: file.c,v 1.23 1996/08/01 12:13:20 jkh Exp $"; #include "lib.h" #include <ftpio.h> +#include <netdb.h> #include <pwd.h> #include <time.h> #include <sys/wait.h> @@ -180,7 +181,7 @@ fileGetURL(char *base, char *spec) struct passwd *pw; FILE *ftp; pid_t tpid; - int i; + int i, status; char *hint; rp = NULL; @@ -246,7 +247,7 @@ fileGetURL(char *base, char *spec) } if (Verbose) printf("Trying to fetch %s.\n", fname); - ftp = ftpGetURL(fname, uname, pword); + ftp = ftpGetURL(fname, uname, pword, &status); if (ftp) { pen[0] = '\0'; if ((rp = make_playpen(pen, 0)) != NULL) { @@ -272,7 +273,9 @@ fileGetURL(char *base, char *spec) fclose(ftp); } else - printf("Error: FTP Unable to get %s\n", fname); + printf("Error: FTP Unable to get %s: %s\n", + fname, + status ? ftpErrString(status) : hstrerror(h_errno)); return rp; } |