changeset 191:4f69e30abbd5

Made sure the wakeup FD is always valid
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 11 Aug 2011 19:33:34 +0300
parents 3ab18984e3e3
children 6e6b0ea63fa1
files upreckon/_unixmodule.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/upreckon/_unixmodule.cpp	Thu Jul 28 20:27:22 2011 +0300
+++ b/upreckon/_unixmodule.cpp	Thu Aug 11 19:33:34 2011 +0300
@@ -1295,6 +1295,7 @@
 	close(intpipe[0]);
 	close(intpipe[1]);
 	intpipe[0] = intpipe[1] = 0;
+	PySignal_SetWakeupFd(-1);
 }
 #endif
 
@@ -1404,8 +1405,6 @@
 		}
 #endif
 	}
-	
-	PySignal_SetWakeupFd(intpipe[1]);
 #endif
 	
 #if PY_MAJOR_VERSION >= 3
@@ -1450,6 +1449,10 @@
 	Py_AtExit(close_intpipe);
 #endif
 	
+#ifdef USE_WAKEUP_FD
+	PySignal_SetWakeupFd(intpipe[1]);
+#endif
+	
 #if PY_MAJOR_VERSION >= 3
 	return module;
 #endif