changeset 23774:91169093449d

More leaks of fds to client processes.
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 12 Aug 2008 23:35:02 +0000
parents 2a8af2ed4b49
children 92d0151e907b a556012a56b9 dc3c31b78fdb
files libpurple/network.c libpurple/protocols/msn/directconn.c libpurple/protocols/msn/servconn.c libpurple/protocols/msnp9/directconn.c libpurple/protocols/msnp9/servconn.c libpurple/protocols/qq/qq_network.c
diffstat 6 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/network.c	Tue Aug 12 23:22:47 2008 +0000
+++ b/libpurple/network.c	Tue Aug 12 23:35:02 2008 +0000
@@ -351,7 +351,9 @@
 	}
 	flags = fcntl(listenfd, F_GETFL);
 	fcntl(listenfd, F_SETFL, flags | O_NONBLOCK);
-
+#ifndef _WIN32
+	fcntl(listenfd, F_SETFD, FD_CLOEXEC);
+#endif
 	actual_port = purple_network_get_port_from_fd(listenfd);
 
 	purple_debug_info("network", "Listening on port: %hu\n", actual_port);
--- a/libpurple/protocols/msn/directconn.c	Tue Aug 12 23:22:47 2008 +0000
+++ b/libpurple/protocols/msn/directconn.c	Tue Aug 12 23:35:02 2008 +0000
@@ -158,6 +158,9 @@
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
--- a/libpurple/protocols/msn/servconn.c	Tue Aug 12 23:22:47 2008 +0000
+++ b/libpurple/protocols/msn/servconn.c	Tue Aug 12 23:35:02 2008 +0000
@@ -557,6 +557,9 @@
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
--- a/libpurple/protocols/msnp9/directconn.c	Tue Aug 12 23:22:47 2008 +0000
+++ b/libpurple/protocols/msnp9/directconn.c	Tue Aug 12 23:35:02 2008 +0000
@@ -159,6 +159,9 @@
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
--- a/libpurple/protocols/msnp9/servconn.c	Tue Aug 12 23:22:47 2008 +0000
+++ b/libpurple/protocols/msnp9/servconn.c	Tue Aug 12 23:35:02 2008 +0000
@@ -547,6 +547,9 @@
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
--- a/libpurple/protocols/qq/qq_network.c	Tue Aug 12 23:22:47 2008 +0000
+++ b/libpurple/protocols/qq/qq_network.c	Tue Aug 12 23:35:02 2008 +0000
@@ -743,6 +743,9 @@
 	/* we use non-blocking mode to speed up connection */
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	/* From Unix-socket-FAQ: http://www.faqs.org/faqs/unix-faq/socket/
 	 *