Parcourir la source

[681] Ignore SIGPIPE in msgq as child write failures are handled by try.

Kean Johnston il y a 11 ans
Parent
commit
b107f99d0a
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      src/bin/msgq/msgq.py.in

+ 6 - 0
src/bin/msgq/msgq.py.in

@@ -808,6 +808,12 @@ def main():
     signal.signal(signal.SIGTERM,
                   lambda signal, frame: signal_handler(msgq, signal, frame))
 
+    # Ignore SIGPIPE. We handle errors writing to children using try in the
+    # appropriate places and the delivery of a signal is very heavy handed.
+    # Windows doesn't support SIGPIPE so don't try it there.
+    if not sys.platform.startswith('win'):
+        signal.signal(signal.SIGPIPE, signal.SIG_IGN)
+
     try:
         msgq.setup()
     except Exception as e: