client: read_events should return -1 after an error
authorMarek Chalupa <mchqwerty@gmail.com>
Mon, 27 Oct 2014 08:19:46 +0000 (09:19 +0100)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 21 Nov 2014 11:59:42 +0000 (13:59 +0200)
commit59f255d66e4dad89f633deec535482faa8bd8561
treed1dc1172ea1f6d78acbc744683b26e8a2210c58e
parent059220549cd080bae970a802856b2c44b2eeb3cc
client: read_events should return -1 after an error

When a thread is sleeping, waiting until another thread read
from the display, it always returns 0. Even when an error
occured. In documentation stands:

  "return 0 on success or -1 on error.  In case of error errno will
   be set accordingly"

So this is a fix for this.

Along with the read_events, fix a test so that it now complies
with this behaviour (and we have this tested)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
src/wayland-client.c
tests/display-test.c