from bup import options
from bup.helpers import *
+# Give the subcommand exclusive access to stdin.
+orig_stdin = os.dup(0)
+devnull = os.open('/dev/null', os.O_RDONLY)
+os.dup2(devnull, 0)
+os.close(devnull)
+
optspec = """
bup mux command [arguments...]
--
def close_fds():
os.close(outr)
os.close(errr)
-p = subprocess.Popen(subcmd, stdout=outw, stderr=errw, preexec_fn=close_fds)
+
+p = subprocess.Popen(subcmd, stdin=orig_stdin, stdout=outw, stderr=errw,
+ preexec_fn=close_fds)
os.close(outw)
os.close(errw)
sys.stdout.write('BUPMUX')