libpurple/protocols/simple/simple.c

changeset 24040
24ff94bfd09d
parent 23495
cc9ee7e6a09f
child 24398
4865c2ee6ea8
child 24638
b272153e8de5
child 26117
69b9346d3e48
--- a/libpurple/protocols/simple/simple.c	Tue Aug 12 23:03:31 2008 +0000
+++ b/libpurple/protocols/simple/simple.c	Tue Aug 12 23:09:05 2008 +0000
@@ -1703,8 +1703,15 @@
 	PurpleConnection *gc = data;
 	struct simple_account_data *sip = gc->proto_data;
 	struct sip_connection *conn;
+	int newfd, flags;
 
-	int newfd = accept(source, NULL, NULL);
+	newfd = accept(source, NULL, NULL);
+
+	flags = fcntl(newfd, F_GETFL);
+	fcntl(newfd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(newfd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	conn = connection_create(sip, newfd);
 

mercurial