diff options
author | Andrei Vagin <avagin@google.com> | 2020-04-22 17:48:59 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-22 17:50:10 -0700 |
commit | 0c586946ea26610b87c4ff7bda783a5a9ca11ec0 (patch) | |
tree | 224308d37aa7a9d146c8cfb851d8b081fb5f8442 /pkg/flipcall | |
parent | 37f863f62813f76b05979494c1bc2fe102629321 (diff) |
Specify a memory file in platform.New().
PiperOrigin-RevId: 307941984
Diffstat (limited to 'pkg/flipcall')
-rw-r--r-- | pkg/flipcall/packet_window_allocator.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/flipcall/packet_window_allocator.go b/pkg/flipcall/packet_window_allocator.go index ccb918fab..af9cc3d21 100644 --- a/pkg/flipcall/packet_window_allocator.go +++ b/pkg/flipcall/packet_window_allocator.go @@ -134,7 +134,7 @@ func (pwa *PacketWindowAllocator) Allocate(size int) (PacketWindowDescriptor, er start := pwa.nextAlloc pwa.nextAlloc = end return PacketWindowDescriptor{ - FD: pwa.fd, + FD: pwa.FD(), Offset: start, Length: size, }, nil @@ -158,7 +158,7 @@ func (pwa *PacketWindowAllocator) ensureFileSize(min int64) error { } newSize = newNewSize } - if err := syscall.Ftruncate(pwa.fd, newSize); err != nil { + if err := syscall.Ftruncate(pwa.FD(), newSize); err != nil { return fmt.Errorf("ftruncate failed: %v", err) } pwa.fileSize = newSize |