diff options
author | fenner <fenner@FreeBSD.org> | 1997-10-02 23:26:03 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 1997-10-02 23:26:03 +0000 |
commit | 02979f47f2976f83c40f993b13a50c81f17b7eb7 (patch) | |
tree | 11891a2c5808a6e6336c919a5ba2428a42fb1d36 /lib/libftpio/ftpio.c | |
parent | e6e30df549649f4d6d4ea0d35b52fa8c7179e278 (diff) | |
download | FreeBSD-src-02979f47f2976f83c40f993b13a50c81f17b7eb7.zip FreeBSD-src-02979f47f2976f83c40f993b13a50c81f17b7eb7.tar.gz |
Teach ftpErrString to format UNIX errnos, since at least ftpLogin()
can return UNIX errnos. When UNIX errnos catch up with FTP status
codes (e.g. at 100) a new way will have to be found to tell which
is which.
This allows fetch to print errors like
fetch: ftp.fu-berlin.de: No route to host
instead of
fetch: ftp.fu-berlin.de: Unknown error
Diffstat (limited to 'lib/libftpio/ftpio.c')
-rw-r--r-- | lib/libftpio/ftpio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index 6ba853e..5be77f4 100644 --- a/lib/libftpio/ftpio.c +++ b/lib/libftpio/ftpio.c @@ -14,7 +14,7 @@ * Turned inside out. Now returns xfers as new file ids, not as a special * `state' of FTP_t * - * $Id: ftpio.c,v 1.26 1997/09/18 14:01:15 phk Exp $ + * $Id: ftpio.c,v 1.27 1997/10/01 07:21:41 jkh Exp $ * */ @@ -182,6 +182,9 @@ ftpErrString(int errno) if (errno == -1) return("connection in wrong state"); + if (errno < 100) + /* XXX soon UNIX errnos will catch up with FTP protocol errnos */ + return strerror(errno); for (k = 0; k < ftpErrListLength; k++) if (ftpErrList[k].num == errno) return(ftpErrList[k].string); |