]> git.tuebingen.mpg.de Git - paraslash.git/commit - gui.c
gui.c Fix error handling of for_each_stat_item().
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 19 Jan 2015 20:17:20 +0000 (21:17 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 20 Jan 2015 08:37:41 +0000 (09:37 +0100)
commit1aef9e5556484d0a2d44370b88121310a8081725
tree16e6309927481f3f38f99e0b358e6188a5aeb99c
parent06bbd651f91353b4e7a63386291d41e5d8fca5ca
gui.c Fix error handling of for_each_stat_item().

In status_post_select(), if read_nonblock() succeeds (ret >= 0)
but for_each_stat_item() fails (ret2 < 0), para_gui aborts with

para_gui: error.h:639: para_strerror: Assertion `num > 0' failed.

This happens for example if the user is not allowed to connect to
para_audiod.

The problem is that the (non-positive) value -ret is passed to
para_strerror() as the error code rather than -ret2. This commit
fixes the bug. It was introduced one year ago in commit f840be8d
(gui: Introduce status_post_select()).
gui.c