浏览代码

don't close all the fd's when you spawn a thread, only when you fork

svn:r1267
Roger Dingledine 21 年之前
父节点
当前提交
1ae45b771e
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 2 1
      src/or/cpuworker.c
  2. 2 1
      src/or/dns.c

+ 2 - 1
src/or/cpuworker.c

@@ -127,8 +127,9 @@ int cpuworker_main(void *data) {
 
 
   close(fdarray[0]); /* this is the side of the socketpair the parent uses */
   close(fdarray[0]); /* this is the side of the socketpair the parent uses */
   fd = fdarray[1]; /* this side is ours */
   fd = fdarray[1]; /* this side is ours */
+#ifndef MS_WINDOWS
   connection_free_all(); /* so the child doesn't hold the parent's fd's open */
   connection_free_all(); /* so the child doesn't hold the parent's fd's open */
-/* XXX probably don't close all the fd's on MS_WINDOWS? */
+#endif
 
 
   for(;;) {
   for(;;) {
 
 

+ 2 - 1
src/or/dns.c

@@ -412,8 +412,9 @@ int dnsworker_main(void *data) {
 
 
   close(fdarray[0]); /* this is the side of the socketpair the parent uses */
   close(fdarray[0]); /* this is the side of the socketpair the parent uses */
   fd = fdarray[1]; /* this side is ours */
   fd = fdarray[1]; /* this side is ours */
+#ifndef MS_WINDOWS
   connection_free_all(); /* so the child doesn't hold the parent's fd's open */
   connection_free_all(); /* so the child doesn't hold the parent's fd's open */
-/* XXX probably don't close all the fd's on MS_WINDOWS? */
+#endif
 
 
   for(;;) {
   for(;;) {