diff options
Diffstat (limited to 'runsc/boot/fds.go')
-rw-r--r-- | runsc/boot/fds.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/runsc/boot/fds.go b/runsc/boot/fds.go index 91c698fea..9de5a78b1 100644 --- a/runsc/boot/fds.go +++ b/runsc/boot/fds.go @@ -16,6 +16,7 @@ package boot import ( "fmt" + "syscall" "gvisor.googlesource.com/gvisor/pkg/sentry/context" "gvisor.googlesource.com/gvisor/pkg/sentry/fs" @@ -27,19 +28,15 @@ import ( // createFDMap creates an fd map that contains stdin, stdout, and stderr. If // console is true, then ioctl calls will be passed through to the host fd. -func createFDMap(ctx context.Context, k *kernel.Kernel, l *limits.LimitSet, console bool, stdioFDs []int) (*kernel.FDMap, error) { - if len(stdioFDs) != 3 { - return nil, fmt.Errorf("stdioFDs should contain exactly 3 FDs (stdin, stdout, and stderr), but %d FDs received", len(stdioFDs)) - } - +func createFDMap(ctx context.Context, k *kernel.Kernel, l *limits.LimitSet, console bool) (*kernel.FDMap, error) { fdm := k.NewFDMap() defer fdm.DecRef() // Maps sandbox fd to host fd. fdMap := map[int]int{ - 0: stdioFDs[0], - 1: stdioFDs[1], - 2: stdioFDs[2], + 0: syscall.Stdin, + 1: syscall.Stdout, + 2: syscall.Stderr, } mounter := fs.FileOwnerFromContext(ctx) |