From 930f6d2f0d7d5ed5847d23c618f1f7084bdfe28e Mon Sep 17 00:00:00 2001 From: Toshio くらとみ Date: Jan 06 2008 19:49:10 +0000 Subject: Add patch for SIGSTOP/SIGINT. --- diff --git a/python-cherrypy-2.2.1-EINTR.patch b/python-cherrypy-2.2.1-EINTR.patch new file mode 100644 index 0000000..4f5b017 --- /dev/null +++ b/python-cherrypy-2.2.1-EINTR.patch @@ -0,0 +1,26 @@ +diff -up cherrypy/_cpwsgiserver.py.EINTR cherrypy/_cpwsgiserver.py +--- cherrypy/_cpwsgiserver.py.EINTR 2006-04-25 03:37:45.000000000 +0200 ++++ cherrypy/_cpwsgiserver.py 2007-11-03 01:14:20.000000000 +0100 +@@ -332,6 +332,22 @@ class CherryPyWSGIServer(object): + # notice keyboard interrupts on Win32, which don't interrupt + # accept() by default + return ++ except socket.error, x: ++ if hasattr(errno, "EINTR") and x.args[0] == errno.EINTR: ++ # I *think* this is right. EINTR should occur when a signal ++ # is received during the accept() call; all docs say retry ++ # the call, and I *think* I'm reading it right that Python ++ # will then go ahead and poll for and handle the signal ++ # elsewhere. See http://www.cherrypy.org/ticket/707. ++ return ++ msg = x.args[1] ++ if msg in ("Bad file descriptor", "Socket operation on non-socket"): ++ # Our socket was closed. ++ return ++ if msg == "Resource temporarily unavailable": ++ # Just try again. See http://www.cherrypy.org/ticket/479. ++ return ++ raise + + def stop(self): + """Gracefully shutdown a server that is serving forever."""