do_iterative_fd_io():
* When do_iterative_fd_io_iterate() fails, we must not invoke the supplied finished hook explicitly, since it is invoked indirectly by request->SetStatusAndNotify() anyway. Should fix #2557. * We must detach the descriptor putter as soon as we have adjusted the request's finished callback, since that will put the descriptor. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26776 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bca3215f8a
commit
be87a4934e
@ -440,6 +440,9 @@ do_iterative_fd_io(int fd, io_request* request, iterative_io_get_vecs getVecs,
|
||||
request->SetFinishedCallback(&do_iterative_fd_io_finish, iterationCookie);
|
||||
request->SetIterationCallback(&do_iterative_fd_io_iterate, iterationCookie);
|
||||
|
||||
descriptorPutter.Detach();
|
||||
// From now on the descriptor is put by our finish callback.
|
||||
|
||||
bool partialTransfer = false;
|
||||
status_t error = do_iterative_fd_io_iterate(iterationCookie, request,
|
||||
&partialTransfer);
|
||||
@ -449,13 +452,9 @@ do_iterative_fd_io(int fd, io_request* request, iterative_io_get_vecs getVecs,
|
||||
request->TransferredBytes());
|
||||
}
|
||||
|
||||
finished(cookie, request, error, request->IsPartialTransfer(),
|
||||
request->TransferredBytes());
|
||||
request->SetStatusAndNotify(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
descriptorPutter.Detach();
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user