mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-11 09:50:12 +00:00
Correct an ancient bogon which involved trying to read() from a
nuked file descriptor. This is probably why sysinstall's ftp xfer occasionally SEGV'd if you left things alone for a long time and the timeout code got called. Whoops!
This commit is contained in:
parent
5848fd5f35
commit
dcb69d91c2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30030
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user