diff --git a/usr.sbin/faithd/ftp.c b/usr.sbin/faithd/ftp.c index e086de69b475..56646814ae3c 100644 --- a/usr.sbin/faithd/ftp.c +++ b/usr.sbin/faithd/ftp.c @@ -237,7 +237,7 @@ ftp_activeconn() return -1; } error = connect(port6, sa, sa->sa_len); - if (port6 == -1) { + if (error < 0) { close(port6); close(port4); close(wport4); @@ -284,7 +284,7 @@ ftp_passiveconn() return -1; } error = connect(port4, sa, sa->sa_len); - if (port4 == -1) { + if (error < 0) { close(wport6); close(port4); close(port6);