Re: [PATCH xspice 1/2] Xspice: cleanup Xorg process on SIGTERM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ACK series

On 10/20/2013 08:34 AM, Alon Levy wrote:
Signed-off-by: Alon Levy <alevy@xxxxxxxxxx>
---
  scripts/Xspice | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/Xspice b/scripts/Xspice
index a4eb647..17439a1 100755
--- a/scripts/Xspice
+++ b/scripts/Xspice
@@ -22,6 +22,7 @@ import sys
  import tempfile
  import atexit
  import time
+import signal
  from subprocess import Popen, PIPE

  def which(x):
@@ -154,7 +155,7 @@ if not args.xorg:
  cleanup_files = []
  cleanup_processes = []

-def cleanup():
+def cleanup(*args):
      for f in cleanup_files:
          if os.path.isfile(f):
              os.remove(f)
@@ -162,12 +163,14 @@ def cleanup():
          p.kill()
      for p in cleanup_processes:
          p.wait()
+    del cleanup_processes[:]

  def launch(*args, **kw):
      p = Popen(*args, **kw)
      cleanup_processes.append(p)
      return p

+signal.signal(signal.SIGTERM, cleanup)
  atexit.register(cleanup)

  if args.auto:


_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]