[BusyBox-cvs] svn commit: trunk/busybox: libbb networking

landley at busybox.net landley at busybox.net
Mon Aug 22 15:57:51 UTC 2005


Author: landley
Date: 2005-08-22 09:57:50 -0600 (Mon, 22 Aug 2005)
New Revision: 11224

Log:
Two FEATURE_CLEAN_UP patches from Shaun Jackman, closing filehandles.


Modified:
   trunk/busybox/libbb/xconnect.c
   trunk/busybox/networking/route.c


Changeset:
Modified: trunk/busybox/libbb/xconnect.c
===================================================================
--- trunk/busybox/libbb/xconnect.c	2005-08-22 13:20:59 UTC (rev 11223)
+++ trunk/busybox/libbb/xconnect.c	2005-08-22 15:57:50 UTC (rev 11224)
@@ -64,6 +64,7 @@
 	int s = socket(AF_INET, SOCK_STREAM, 0);
 	if (connect(s, (struct sockaddr_in *)s_addr, sizeof(struct sockaddr_in)) < 0)
 	{
+		if (ENABLE_FEATURE_CLEAN_UP) close(s);
 		bb_perror_msg_and_die("Unable to connect to remote host (%s)",
 				inet_ntoa(s_addr->sin_addr));
 	}

Modified: trunk/busybox/networking/route.c
===================================================================
--- trunk/busybox/networking/route.c	2005-08-22 13:20:59 UTC (rev 11223)
+++ trunk/busybox/networking/route.c	2005-08-22 15:57:50 UTC (rev 11224)
@@ -329,8 +329,7 @@
 		bb_perror_msg_and_die("SIOC[ADD|DEL]RT");
 	}
 
-	/* Don't bother closing, as we're exiting after we return anyway. */
-	/* close(skfd); */
+	if (ENABLE_FEATURE_CLEAN_UP) close(skfd);
 }
 
 #ifdef CONFIG_FEATURE_IPV6
@@ -440,8 +439,7 @@
 		bb_perror_msg_and_die("SIOC[ADD|DEL]RT");
 	}
 
-	/* Don't bother closing, as we're exiting after we return anyway. */
-	/* close(skfd); */
+	if (ENABLE_FEATURE_CLEAN_UP) close(skfd);
 }
 #endif
 




More information about the busybox-cvs mailing list