From 8973ce563724559f736d95c700cfb304a67d46c2 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Wed, 18 Sep 2019 21:21:37 +0000 Subject: [PATCH] Return error from update when there are no pending clients --- src/server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index 1435f02..bfcb3a6 100644 --- a/src/server.c +++ b/src/server.c @@ -821,6 +821,8 @@ void on_client_update_fb_done(uv_work_t *work, int status) if (--server->n_pending_updates == 0) if (update->on_done) update->on_done(server); + + assert(server->n_pending_updates >= 0); } int schedule_client_update_fb(struct nvnc_client *client, @@ -902,7 +904,7 @@ int nvnc_update_fb(struct nvnc *self, const struct nvnc_fb *fb, schedule_client_update_fb(client, fb, ®ion, on_update_done); } - rc = 0; + rc = self->n_pending_updates > 0 ? 0 : -1; failure: pixman_region_fini(®ion); return rc;