summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/tmpfs/named_pipe.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-03-25 14:44:18 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-25 14:49:13 -0700
commitc7f5673529af758c9f7c95523535174c7929dab5 (patch)
tree84a21d90c5d42a996d69bfdedfaa28a008efac37 /pkg/sentry/fsimpl/tmpfs/named_pipe.go
parent2e09f2bdce11d5f303333c68af4272abb62b7885 (diff)
Set file mode and type to attribute
Makes less error prone to find file type. Updates #1197 PiperOrigin-RevId: 302974244
Diffstat (limited to 'pkg/sentry/fsimpl/tmpfs/named_pipe.go')
-rw-r--r--pkg/sentry/fsimpl/tmpfs/named_pipe.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/tmpfs/named_pipe.go b/pkg/sentry/fsimpl/tmpfs/named_pipe.go
index 0c57fdca3..2c5c739df 100644
--- a/pkg/sentry/fsimpl/tmpfs/named_pipe.go
+++ b/pkg/sentry/fsimpl/tmpfs/named_pipe.go
@@ -34,7 +34,7 @@ type namedPipe struct {
// * rp.Mount().CheckBeginWrite() has been called successfully.
func (fs *filesystem) newNamedPipe(creds *auth.Credentials, mode linux.FileMode) *inode {
file := &namedPipe{pipe: pipe.NewVFSPipe(pipe.DefaultPipeSize, usermem.PageSize)}
- file.inode.init(file, fs, creds, mode)
+ file.inode.init(file, fs, creds, linux.S_IFIFO|mode)
file.inode.nlink = 1 // Only the parent has a link.
return &file.inode
}