summaryrefslogtreecommitdiffstats
path: root/lib/libftpio/ftpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libftpio/ftpio.c')
-rw-r--r--lib/libftpio/ftpio.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c
index 5be77f4..877896c 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.27 1997/10/01 07:21:41 jkh Exp $
+ * $Id: ftpio.c,v 1.28 1997/10/02 23:26:03 fenner Exp $
*
*/
@@ -103,7 +103,7 @@ networkInit()
static int
check_code(FTP_t ftp, int var, int preferred)
{
- ftp->errno = 0;
+ ftp->error = 0;
while (1) {
if (var == preferred)
return 0;
@@ -114,7 +114,7 @@ check_code(FTP_t ftp, int var, int preferred)
else if (var == FTP_GENERALLY_HAPPY) /* general success code */
var = get_a_number(ftp, NULL);
else {
- ftp->errno = var;
+ ftp->error = var;
return 1;
}
}
@@ -172,21 +172,21 @@ int
ftpErrno(FILE *fp)
{
FTP_t ftp = fcookie(fp);
- return ftp->errno;
+ return ftp->error;
}
const char *
-ftpErrString(int errno)
+ftpErrString(int error)
{
int k;
- if (errno == -1)
+ if (error == -1)
return("connection in wrong state");
- if (errno < 100)
+ if (error < 100)
/* XXX soon UNIX errnos will catch up with FTP protocol errnos */
- return strerror(errno);
+ return strerror(error);
for (k = 0; k < ftpErrListLength; k++)
- if (ftpErrList[k].num == errno)
+ if (ftpErrList[k].num == error)
return(ftpErrList[k].string);
return("Unknown error");
}
@@ -285,7 +285,7 @@ ftpLogin(char *host, char *user, char *passwd, int port, int verbose, int *retco
if (!n)
*retcode = (FtpTimedOut ? FTP_TIMED_OUT : -1);
/* Poor attempt at mapping real errnos to FTP error codes */
- else switch(n->errno) {
+ else switch(n->error) {
case EADDRNOTAVAIL:
*retcode = FTP_TIMED_OUT; /* Actually no such host, but we have no way of saying that. :-( */
break;
@@ -295,7 +295,7 @@ ftpLogin(char *host, char *user, char *passwd, int port, int verbose, int *retco
break;
default:
- *retcode = n->errno;
+ *retcode = n->error;
break;
}
}
@@ -457,7 +457,7 @@ ftp_new(void)
ftp->is_binary = FALSE;
ftp->is_passive = FALSE;
ftp->is_verbose = FALSE;
- ftp->errno = 0;
+ ftp->error = 0;
return ftp;
}
@@ -616,7 +616,7 @@ ftp_close(FTP_t ftp)
if (ftp->con_state == isopen) {
ftp->con_state = quit;
/* If last operation timed out, don't try to quit - just close */
- if (ftp->errno != FTP_TIMED_OUT)
+ if (ftp->error != FTP_TIMED_OUT)
i = cmd(ftp, "QUIT");
else
i = FTP_QUIT_HAPPY;
@@ -677,7 +677,7 @@ ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port, int
if (ftp->con_state != init) {
ftp_close(ftp);
- ftp->errno = -1;
+ ftp->error = -1;
return FAILURE;
}
@@ -698,7 +698,7 @@ ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port, int
else {
he = gethostbyname(host);
if (!he) {
- ftp->errno = 0;
+ ftp->error = 0;
return FAILURE;
}
ftp->addrtype = sin.sin_family = he->h_addrtype;
@@ -708,13 +708,13 @@ ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port, int
sin.sin_port = htons(port);
if ((s = socket(ftp->addrtype, SOCK_STREAM, 0)) < 0) {
- ftp->errno = -1;
+ ftp->error = -1;
return FAILURE;
}
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
(void)close(s);
- ftp->errno = errno;
+ ftp->error = errno;
return FAILURE;
}
@@ -728,7 +728,7 @@ ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port, int
if (i >= 299 || i < 0) {
ftp_close(ftp);
if (i > 0)
- ftp->errno = i;
+ ftp->error = i;
return FAILURE;
}
return SUCCESS;
@@ -751,7 +751,7 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t
return botch("ftp_file_op", "open");
if ((s = socket(ftp->addrtype, SOCK_STREAM, 0)) < 0) {
- ftp->errno = errno;
+ ftp->error = errno;
return FAILURE;
}
@@ -761,7 +761,7 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t
if (writes(ftp->fd_ctrl, "PASV\r\n")) {
ftp_close(ftp);
if (FtpTimedOut)
- ftp->errno = FTP_TIMED_OUT;
+ ftp->error = FTP_TIMED_OUT;
return FTP_TIMED_OUT;
}
i = get_a_number(ftp, &q);
@@ -793,7 +793,7 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t
i = cmd(ftp, "REST %d", *seekto);
if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
- ftp->errno = i;
+ ftp->error = i;
*seekto = (off_t)0;
return i;
}
@@ -801,7 +801,7 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t
i = cmd(ftp, "%s %s", operation, file);
if (i < 0 || i > 299) {
close(s);
- ftp->errno = i;
+ ftp->error = i;
return i;
}
*fp = fdopen(s, mode);
@@ -838,7 +838,7 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t
i = cmd(ftp, "REST %d", *seekto);
if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
- ftp->errno = i;
+ ftp->error = i;
return i;
}
else if (i != 350)
@@ -847,13 +847,13 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, off_t
i = cmd(ftp, "%s %s", operation, file);
if (i < 0 || i > 299) {
close(s);
- ftp->errno = i;
+ ftp->error = i;
return FAILURE;
}
fd = accept(s, 0, 0);
if (fd < 0) {
close(s);
- ftp->errno = 401;
+ ftp->error = 401;
return FAILURE;
}
close(s);
OpenPOWER on IntegriCloud