rpms/python-cherrypy/EL-5 python-cherrypy-2.2.1-EINTR.patch, NONE, 1.1
Toshio くらとみ (toshio)
fedora-extras-commits at redhat.com
Sun Jan 6 19:49:39 UTC 2008
Author: toshio
Update of /cvs/pkgs/rpms/python-cherrypy/EL-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13289
Added Files:
python-cherrypy-2.2.1-EINTR.patch
Log Message:
* Add patch for SIGSTOP/SIGINT.
python-cherrypy-2.2.1-EINTR.patch:
--- NEW FILE python-cherrypy-2.2.1-EINTR.patch ---
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."""
More information about the fedora-extras-commits
mailing list