If an error happens, listen was returning 1 instead of -1. Signed-off-by: Francois Berder <francois.berder@imgtec.com>