diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-01-08 08:06:37 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-08 08:06:37 +0000 |
commit | 9b13bda4baa8ddb2b4d71abcdb959c3b3a7832cc (patch) | |
tree | 77e8f4fab5c0e9449d1ae3e86b88492f786d62f2 /pkg/sentry/fs/file.go | |
parent | a91d38c14707db1fae950a1fb4720332ae20c15a (diff) | |
parent | a53ac7307abfeb7172e67f48d0a7aaa4b5c3f31e (diff) |
Merge release-20191213.0-69-ga53ac73 (automated)
Diffstat (limited to 'pkg/sentry/fs/file.go')
-rw-r--r-- | pkg/sentry/fs/file.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/sentry/fs/file.go b/pkg/sentry/fs/file.go index c0a6e884b..a2f966cb6 100644 --- a/pkg/sentry/fs/file.go +++ b/pkg/sentry/fs/file.go @@ -555,6 +555,10 @@ type lockedWriter struct { // // This applies only to Write, not WriteAt. Offset int64 + + // Err contains the first error encountered while copying. This is + // useful to determine whether Writer or Reader failed during io.Copy. + Err error } // Write implements io.Writer.Write. @@ -590,5 +594,8 @@ func (w *lockedWriter) WriteAt(buf []byte, offset int64) (int, error) { break } } + if w.Err == nil { + w.Err = err + } return written, err } |