aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/faithd/ftp.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2001-08-20 15:01:06 +0000
committerBrian Somers <brian@FreeBSD.org>2001-08-20 15:01:06 +0000
commitf0183cc46aa18095dea6ce4d9b52acd69836baca (patch)
tree691dba17dea823650627c295461297c94f4bac2b /usr.sbin/faithd/ftp.c
parent9cfe90fe1f970e051fb3389776d446e66f06bb3c (diff)
downloadsrc-f0183cc46aa18095dea6ce4d9b52acd69836baca.tar.gz
src-f0183cc46aa18095dea6ce4d9b52acd69836baca.zip
Handle ftp_copycommand() and ftp_copyresult() potentially returning < -1.
Notes
Notes: svn path=/head/; revision=81981
Diffstat (limited to 'usr.sbin/faithd/ftp.c')
-rw-r--r--usr.sbin/faithd/ftp.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.sbin/faithd/ftp.c b/usr.sbin/faithd/ftp.c
index 037453e53a6c..851409f0a53b 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)) {