Skip to content

Commit 71b4779

Browse files
committed
exec: avoid clobbering timeout
Signed-off-by: eriknordmark <[email protected]> (cherry picked from commit 7142b9d)
1 parent 7ffef97 commit 71b4779

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/pillar/base/execwrapper.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ func (c *Command) Output() ([]byte, error) {
4848
var buf bytes.Buffer
4949
c.command.Stdout = &buf
5050
c.buffer = &buf
51-
c.timeout = defaultTimeout
51+
if c.timeout == 0 {
52+
c.timeout = defaultTimeout
53+
}
5254
return c.execCommand()
5355
}
5456

@@ -59,7 +61,9 @@ func (c *Command) CombinedOutput() ([]byte, error) {
5961
c.command.Stdout = &buf
6062
c.command.Stderr = &buf
6163
c.buffer = &buf
62-
c.timeout = defaultTimeout
64+
if c.timeout == 0 {
65+
c.timeout = defaultTimeout
66+
}
6367
return c.execCommand()
6468
}
6569

0 commit comments

Comments
 (0)