diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-10-01 07:21:41 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-10-01 07:21:41 +0000 |
| commit | dcb69d91c2da07075f8fc69d408a6dac49d1dd09 (patch) | |
| tree | e37687572ae85be8eec1dfc5260cfe8fccbb0689 /lib | |
| parent | 5848fd5f358614dd2bb8fb10a07bdf1d19103932 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libftpio/ftpio.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index 528747759690..6ba853e37659 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.25 1997/02/22 15:06:50 peter Exp $ + * $Id: ftpio.c,v 1.26 1997/09/18 14:01:15 phk Exp $ * */ @@ -607,8 +607,9 @@ get_a_number(FTP_t ftp, char **q) static int ftp_close(FTP_t ftp) { - int i; + int i, rcode; + rcode = FAILURE; if (ftp->con_state == isopen) { ftp->con_state = quit; /* If last operation timed out, don't try to quit - just close */ @@ -616,17 +617,14 @@ ftp_close(FTP_t ftp) i = cmd(ftp, "QUIT"); else i = FTP_QUIT_HAPPY; + if (!check_code(ftp, i, FTP_QUIT_HAPPY)) + rcode = SUCCESS; close(ftp->fd_ctrl); ftp->fd_ctrl = -1; - if (check_code(ftp, i, FTP_QUIT_HAPPY)) { - ftp->errno = i; - return FAILURE; - } - /* Debug("ftp_pkg: ftp_close() - proper shutdown"); */ - return SUCCESS; } - /* Debug("ftp_pkg: ftp_close() - improper shutdown"); */ - return FAILURE; + else if (ftp->con_state == quit) + rcode = SUCCESS; + return rcode; } static int |
