summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/dev/random.go
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2019-03-27 11:07:41 -0700
committerShentubot <shentubot@google.com>2019-03-27 11:08:50 -0700
commit645af7cdd8a183ce80218b1ad275001084c133ce (patch)
tree26fe08e76fdd48f56730f8e09e2d80a4b3b2c784 /pkg/sentry/fs/dev/random.go
parent66181f3de9926168bf6410e9cff9e05b6ed8ace3 (diff)
Dev device methods should take pointer receiver.
PiperOrigin-RevId: 240600504 Change-Id: I7dd5f27c8da31f24b68b48acdf8f1c19dbd0c32d
Diffstat (limited to 'pkg/sentry/fs/dev/random.go')
-rw-r--r--pkg/sentry/fs/dev/random.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/fs/dev/random.go b/pkg/sentry/fs/dev/random.go
index 837b7793a..b9b78db7a 100644
--- a/pkg/sentry/fs/dev/random.go
+++ b/pkg/sentry/fs/dev/random.go
@@ -51,7 +51,7 @@ func newRandomDevice(ctx context.Context, owner fs.FileOwner, mode linux.FileMod
}
// GetFile implements fs.InodeOperations.GetFile.
-func (randomDevice) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error) {
+func (*randomDevice) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error) {
return fs.NewFile(ctx, dirent, flags, &randomFileOperations{}), nil
}
@@ -71,6 +71,6 @@ type randomFileOperations struct {
var _ fs.FileOperations = (*randomFileOperations)(nil)
// Read implements fs.FileOperations.Read.
-func (randomFileOperations) Read(ctx context.Context, _ *fs.File, dst usermem.IOSequence, _ int64) (int64, error) {
+func (*randomFileOperations) Read(ctx context.Context, _ *fs.File, dst usermem.IOSequence, _ int64) (int64, error) {
return dst.CopyOutFrom(ctx, safemem.FromIOReader{rand.Reader})
}