Shift the resposibility of setting initial status from set_async_direct_result request handler to async_set_result().
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com ---
Notes: v3 -> v4: new patch
server/async.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/server/async.c b/server/async.c index e92d4583c1e..d49fb8b7c04 100644 --- a/server/async.c +++ b/server/async.c @@ -302,7 +302,6 @@ struct async *create_async( struct fd *fd, struct thread *thread, const async_da * the initial status may be STATUS_PENDING */ void async_set_initial_status( struct async *async, unsigned int status ) { - assert( async->unknown_status ); async->initial_status = status; async->unknown_status = 0; } @@ -482,6 +481,8 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
assert( async->terminated ); /* it must have been woken up if we get a result */
+ if (async->unknown_status) async_set_initial_status( async, status ); + if (async->alerted && status == STATUS_PENDING) /* restart it */ { async->terminated = 0; @@ -766,8 +767,6 @@ DECL_HANDLER(set_async_direct_result) return; }
- async_set_initial_status( async, status ); - if (status == STATUS_PENDING) { async->direct_result = 0;