summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/file.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-06-18 08:49:51 +0000
committergVisor bot <gvisor-bot@google.com>2019-06-18 08:49:51 +0000
commitb7d87eb0fb93cac42b5c9034fb22351743823ed7 (patch)
tree3398182f3f61577a40926e2e04a78d03d2058bb6 /pkg/sentry/fs/file.go
parente942d4c88fef76dffacb1de8e4d2fa2e0a282926 (diff)
parent8ab0848c70fcebe377a0e7abdebf371022c96830 (diff)
Merge 8ab0848c (automated)
Diffstat (limited to 'pkg/sentry/fs/file.go')
-rw-r--r--pkg/sentry/fs/file.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/fs/file.go b/pkg/sentry/fs/file.go
index 6df7d7b4f..55ffe6c0c 100644
--- a/pkg/sentry/fs/file.go
+++ b/pkg/sentry/fs/file.go
@@ -267,7 +267,7 @@ func (f *File) Readv(ctx context.Context, dst usermem.IOSequence) (int64, error)
reads.Increment()
n, err := f.FileOperations.Read(ctx, f, dst, f.offset)
- if n > 0 {
+ if n > 0 && !f.flags.NonSeekable {
atomic.AddInt64(&f.offset, n)
}
f.mu.Unlock()
@@ -330,7 +330,7 @@ func (f *File) Writev(ctx context.Context, src usermem.IOSequence) (int64, error
// We must hold the lock during the write.
n, err := f.FileOperations.Write(ctx, f, src, f.offset)
- if n >= 0 {
+ if n >= 0 && !f.flags.NonSeekable {
atomic.StoreInt64(&f.offset, f.offset+n)
}
f.mu.Unlock()