diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-11-16 12:42:30 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-11-16 12:48:02 +0100 |
| commit | c4d43f47732557a32357a36d6c4276707e5994b1 (patch) | |
| tree | 1a02777902c6dc71463b19cc285516f29638bf03 /pkg/git/git.go | |
| parent | 4bc654f91141ca34b336a1f1ae164c851e66c47c (diff) | |
pkg/osutil: don't leace runaway processes
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
Diffstat (limited to 'pkg/git/git.go')
| -rw-r--r-- | pkg/git/git.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/git/git.go b/pkg/git/git.go index 0178a3004..e4a54f71d 100644 --- a/pkg/git/git.go +++ b/pkg/git/git.go @@ -8,7 +8,6 @@ import ( "bytes" "fmt" "os" - "os/exec" "regexp" "strings" "time" @@ -154,13 +153,13 @@ var commitPrefixes = []string{ func Patch(dir string, patch []byte) error { // Do --dry-run first to not mess with partially consistent state. - cmd := exec.Command("patch", "-p1", "--force", "--ignore-whitespace", "--dry-run") + cmd := osutil.Command("patch", "-p1", "--force", "--ignore-whitespace", "--dry-run") cmd.Stdin = bytes.NewReader(patch) cmd.Dir = dir if output, err := cmd.CombinedOutput(); err != nil { // If it reverses clean, then it's already applied // (seems to be the easiest way to detect it). - cmd = exec.Command("patch", "-p1", "--force", "--ignore-whitespace", "--reverse", "--dry-run") + cmd = osutil.Command("patch", "-p1", "--force", "--ignore-whitespace", "--reverse", "--dry-run") cmd.Stdin = bytes.NewReader(patch) cmd.Dir = dir if _, err := cmd.CombinedOutput(); err == nil { @@ -169,7 +168,7 @@ func Patch(dir string, patch []byte) error { return fmt.Errorf("failed to apply patch:\n%s", output) } // Now apply for real. - cmd = exec.Command("patch", "-p1", "--force", "--ignore-whitespace") + cmd = osutil.Command("patch", "-p1", "--force", "--ignore-whitespace") cmd.Stdin = bytes.NewReader(patch) cmd.Dir = dir if output, err := cmd.CombinedOutput(); err != nil { |
