diff options
author | brian <brian@FreeBSD.org> | 2001-08-20 15:01:06 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-20 15:01:06 +0000 |
commit | 894d298c86524f82e074b5df0bb25939bc20c3ec (patch) | |
tree | 691dba17dea823650627c295461297c94f4bac2b /usr.sbin/faithd | |
parent | 6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59 (diff) | |
download | FreeBSD-src-894d298c86524f82e074b5df0bb25939bc20c3ec.zip FreeBSD-src-894d298c86524f82e074b5df0bb25939bc20c3ec.tar.gz |
Handle ftp_copycommand() and ftp_copyresult() potentially returning < -1.
Diffstat (limited to 'usr.sbin/faithd')
-rw-r--r-- | usr.sbin/faithd/ftp.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.sbin/faithd/ftp.c b/usr.sbin/faithd/ftp.c index 037453e..851409f 100644 --- a/usr.sbin/faithd/ftp.c +++ b/usr.sbin/faithd/ftp.c @@ -120,16 +120,12 @@ ftp_relay(int ctl6, int ctl4) */ error = ftp_copycommand(ctl6, ctl4, &state); - switch (error) { - case -1: + if (error < 0) goto bad; - case 0: + else if (error == 0) { close(ctl4); close(ctl6); exit_success("terminating ftp control connection"); - /*NOTREACHED*/ - default: - break; } } if (FD_ISSET(ctl4, &readfds)) { @@ -139,16 +135,12 @@ ftp_relay(int ctl6, int ctl4) */ error = ftp_copyresult(ctl4, ctl6, state); - switch (error) { - case -1: + if (error < 0) goto bad; - case 0: + else if (error == 0) { close(ctl4); close(ctl6); exit_success("terminating ftp control connection"); - /*NOTREACHED*/ - default: - break; } } if (0 <= port4 && 0 <= port6 && FD_ISSET(port4, &readfds)) { |