summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/socket/rpcinet/socket.go23
1 files changed, 1 insertions, 22 deletions
diff --git a/pkg/sentry/socket/rpcinet/socket.go b/pkg/sentry/socket/rpcinet/socket.go
index 29546b683..69cf604b7 100644
--- a/pkg/sentry/socket/rpcinet/socket.go
+++ b/pkg/sentry/socket/rpcinet/socket.go
@@ -145,29 +145,8 @@ func (s *socketOperations) Read(ctx context.Context, _ *fs.File, dst usermem.IOS
n, e := dst.CopyOut(ctx, res.Data)
return int64(n), e
}
- if se != syserr.ErrWouldBlock {
- return 0, se.ToError()
- }
-
- // We'll have to block. Register for notifications and read again when ready.
- e, ch := waiter.NewChannelEntry(nil)
- s.EventRegister(&e, waiter.EventIn)
- defer s.EventUnregister(&e)
- for {
- res, se := rpcRead(ctx.(*kernel.Task), req)
- if se == nil {
- n, e := dst.CopyOut(ctx, res.Data)
- return int64(n), e
- }
- if se != syserr.ErrWouldBlock {
- return 0, se.ToError()
- }
-
- if err := ctx.(*kernel.Task).Block(ch); err != nil {
- return 0, err
- }
- }
+ return 0, se.ToError()
}
func rpcWrite(t *kernel.Task, req *pb.SyscallRequest_Write) (uint32, *syserr.Error) {