~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/strace.py

  • Committer: Vincent Ladeuil
  • Date: 2007-07-02 14:09:40 UTC
  • mto: (2584.1.1 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 2585.
  • Revision ID: v.ladeuil+lp@free.fr-20070702140940-oz36hfh6hcihlgbj
Fix typo, add comment, following Martin's review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    # thread is running. The following allows the test suite to disable fork
40
40
    # following to work around the bug.  It's a bit dirty to pollute the kwargs
41
41
    # so we take a likely-to-be-unique name to avoid conflicts (*args and
42
 
    # *kwargs are related to 'function').
43
 
    follow_childrens = kwargs.pop('strace_follow_childrens', True)
 
42
    # *kwargs are related to 'function'). It's also ugly, but the best
 
43
    # alternative I can think of is to declare another function, which is ugly
 
44
    # too.
 
45
    follow_children = kwargs.pop('strace_follow_children', True)
44
46
    # capture strace output to a file
45
47
    log_file = tempfile.NamedTemporaryFile()
46
48
    log_file_fd = log_file.fileno()
47
49
    pid = os.getpid()
48
50
    # start strace
49
51
    strace_cmd = ['strace', '-r', '-tt', '-p', str(pid), '-o', log_file.name]
50
 
    if follow_childrens:
 
52
    if follow_children:
51
53
        strace_args.append('-f')
52
54
    proc = subprocess.Popen(strace_cmd,
53
55
                            stdout=subprocess.PIPE,