From b1cb1b02f102fe18bf9bbcbef37ae130c994a5ea Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Thu, 2 Oct 1997 23:26:03 +0000 Subject: [PATCH] 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 --- lib/libftpio/ftpio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index 6ba853e3765..5be77f49234 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);