]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/client.py
Correctly pass along SIGINT to child processes.
[bup.git] / lib / bup / client.py
index 7b3e7c35700dbc914f5301c35e872f42e43082a1..a5762ae4b652c4f552beae6d92ee593a09fa8941 100644 (file)
@@ -39,12 +39,16 @@ class Client:
                    """ % escapedir
             argv = ['ssh', host, '--', cmd.strip()]
             #log('argv is: %r\n' % argv)
+        def setup():
+            if fixenv:
+                fixenv()
+            os.setsid()
         (self.host, self.dir) = (host, dir)
         self.cachedir = git.repo('index-cache/%s'
                                  % re.sub(r'[^@\w]', '_', 
                                           "%s:%s" % (host, dir)))
         try:
-            self.p = p = Popen(argv, stdin=PIPE, stdout=PIPE, preexec_fn=fixenv)
+            self.p = p = Popen(argv, stdin=PIPE, stdout=PIPE, preexec_fn=setup)
         except OSError, e:
             raise ClientError, 'exec %r: %s' % (argv[0], e), sys.exc_info()[2]
         self.conn = conn = Conn(p.stdout, p.stdin)