diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1996-11-14 09:44:09 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1996-11-14 09:44:09 +0000 |
| commit | bbd3d24b96068fb416a7c2f820c481f20c486ebb (patch) | |
| tree | 2d90ecdb7c0d7f5004533c33d478b78beca6ec3d | |
| parent | 7c219eac8f91b310b4140b7dcaee50bc2e55e60f (diff) | |
Notes
| -rw-r--r-- | lib/libftpio/ftpio.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index 5df25b50cfd0..447d71a1d6a3 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.17 1996/11/14 05:22:12 ache Exp $ + * $Id: ftpio.c,v 1.18 1996/11/14 06:59:39 ache Exp $ * */ @@ -357,25 +357,17 @@ ftpPutURL(char *url, char *user, char *passwd, int *retcode) { char host[255], name[255]; int port; - static FILE *fp = NULL; - FILE *fp2; + FILE *fp, *fp2; if (retcode) *retcode = 0; - if (fp) { /* Close previous managed connection */ - fclose(fp); - fp = NULL; - } if (get_url_info(url, host, &port, name) == SUCCESS) { fp = ftpLogin(host, user, passwd, port, 0, retcode); if (fp) { fp2 = ftpPut(fp, name); - if (!fp2) { - if (retcode) - *retcode = ftpErrno(fp); - fclose(fp); - fp = NULL; - } + if (!fp2 && retcode) + *retcode = ftpErrno(fp); + fclose(fp); return fp2; } } |
