summaryrefslogtreecommitdiffstats
path: root/source3/modules/vfs_default.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r--source3/modules/vfs_default.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 7dd9c0ca3e..02ab35b128 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -793,44 +793,39 @@ static void vfswrap_asys_finished(struct tevent_context *ev,
uint16_t flags, void *p)
{
struct asys_context *asys_ctx = (struct asys_context *)p;
- struct tevent_req *req;
- struct vfswrap_asys_state *state;
- int res;
- ssize_t ret;
- int err;
- void *private_data;
if ((flags & TEVENT_FD_READ) == 0) {
return;
}
while (true) {
- res = asys_result(asys_ctx, &ret, &err, &private_data);
- if (res == EINTR || res == EAGAIN) {
+ struct tevent_req *req;
+ struct vfswrap_asys_state *state;
+ struct asys_result result;
+ int res;
+
+ res = asys_results(asys_ctx, &result, 1);
+ if (res < 0) {
+ DEBUG(1, ("asys_result returned %s\n",
+ strerror(-res)));
return;
}
-#ifdef EWOULDBLOCK
- if (res == EWOULDBLOCK) {
- return;
- }
-#endif
-
- if (res == ECANCELED) {
+ if (res == 0) {
return;
}
- if (res != 0) {
- DEBUG(1, ("asys_result returned %s\n", strerror(res)));
+ if ((result.ret == -1) && (result.err == ECANCELED)) {
return;
}
- req = talloc_get_type_abort(private_data, struct tevent_req);
+ req = talloc_get_type_abort(result.private_data,
+ struct tevent_req);
state = tevent_req_data(req, struct vfswrap_asys_state);
talloc_set_destructor(state, NULL);
- state->ret = ret;
- state->err = err;
+ state->ret = result.ret;
+ state->err = result.err;
tevent_req_defer_callback(req, ev);
tevent_req_done(req);
}