Skip to content

Commit

Permalink
main.py: use execvp() instead of subprocess.Popen() when possible.
Browse files Browse the repository at this point in the history
This avoids an extra process showing up in the 'ps' listing if we're not
going to be using bup-newliner anyhow.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  • Loading branch information
apenwarr committed Feb 13, 2011
1 parent 779f523 commit 5ef8f0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,12 @@ def handler(signum, frame):
try:
try:
c = (do_profile and [sys.executable, '-m', 'cProfile'] or []) + subcmd
p = subprocess.Popen(c, stdout=outf, stderr=errf, preexec_fn=force_tty)
if not n and not outf and not errf:
# shortcut when no bup-newliner stuff is needed
os.execvp(c[0], c)
else:
p = subprocess.Popen(c, stdout=outf, stderr=errf,
preexec_fn=force_tty)
while 1:
# if we get a signal while waiting, we have to keep waiting, just
# in case our child doesn't die.
Expand Down

0 comments on commit 5ef8f0d

Please sign in to comment.