Blame SOURCES/netkit-ftp-0.17-data.patch

4f574c
--- netkit-ftp-0.17/ftp/ftp.c.data	2005-12-02 15:31:27.000000000 +0100
4f574c
+++ netkit-ftp-0.17/ftp/ftp.c	2005-12-02 15:35:46.000000000 +0100
4f574c
@@ -1223,6 +1223,7 @@
4f574c
 static int
4f574c
 initconn(void)
4f574c
 {
4f574c
+	int rc;
4f574c
 	u_char *p, *a;
4f574c
 	int result, tmpno = 0;
4f574c
 	socklen_t len;
4f574c
@@ -1240,6 +1241,13 @@
4f574c
 	}
4f574c
 #endif
4f574c
 	if (passivemode) {
4f574c
+		if (data >= 0){
4f574c
+			rc = close (data);
4f574c
+			data = -1;
4f574c
+			if (rc == -1){
4f574c
+				perror ("ftp: close");
4f574c
+			}
4f574c
+		}
4f574c
 		data_addr = hisctladdr;
4f574c
 		data = socket(data_addr.su_family, SOCK_STREAM, 0);
4f574c
 		if (data < 0) {