diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-25 01:26:51 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-25 01:26:51 +0000 |
commit | c7f9505a1c5be69cb2e3716eb7f0deddf9abe621 (patch) | |
tree | 4be35610c6b0e5cc32451d67e9ee39bedbcafdf1 /runsc/boot/loader.go | |
parent | 8239253b718d0c94976d8accac51a388d411cdb0 (diff) | |
parent | 15a822a1936e295cb6418df7ddf445d8500dfb2e (diff) |
Merge release-20200323.0-248-g15a822a (automated)
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r-- | runsc/boot/loader.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index 3f41d8357..f6ea4c102 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -625,11 +625,14 @@ func (l *Loader) run() error { // l.stdioFDs are derived from dup() in boot.New() and they are now dup()ed again // either in createFDTable() during initial start or in descriptor.initAfterLoad() - // during restore, we can release l.stdioFDs now. - for _, fd := range l.stdioFDs { - err := syscall.Close(fd) - if err != nil { - return fmt.Errorf("close dup()ed stdioFDs: %v", err) + // during restore, we can release l.stdioFDs now. VFS2 takes ownership of the + // passed FDs, so only close for VFS1. + if !kernel.VFS2Enabled { + for _, fd := range l.stdioFDs { + err := syscall.Close(fd) + if err != nil { + return fmt.Errorf("close dup()ed stdioFDs: %v", err) + } } } |