Make _fetch_connect() always set the error code.

Tell ftp that _fetch_connect() always sets the error code (http already knew)
This commit is contained in:
Bill Fenner 2002-09-17 05:54:33 +00:00
parent 117f87fe9f
commit 40cfbfd508
2 changed files with 5 additions and 4 deletions

View File

@ -271,8 +271,10 @@ _fetch_connect(const char *host, int port, int af, int verbose)
return (NULL);
}
if ((conn = _fetch_reopen(sd)) == NULL)
if ((conn = _fetch_reopen(sd)) == NULL) {
_fetch_syserr();
close(sd);
}
return (conn);
}

View File

@ -796,10 +796,9 @@ _ftp_connect(struct url *url, struct url *purl, const char *flags)
}
/* check connection */
if (conn == NULL) {
_fetch_syserr();
if (conn == NULL)
/* _fetch_connect() has already set an error code */
return (NULL);
}
/* expect welcome message */
if ((e = _ftp_chkerr(conn)) != FTP_SERVICE_READY)