From 69d230d065d68af2e3651ed99d513dd576be7b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret?= Date: Mon, 25 Sep 2017 16:55:25 +0200 Subject: [PATCH] fix fallthrough: add specific error message with respect to 'select' return value --- qrexec/qrexec-client.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qrexec/qrexec-client.c b/qrexec/qrexec-client.c index be87ddc..fc6c6f5 100644 --- a/qrexec/qrexec-client.c +++ b/qrexec/qrexec-client.c @@ -627,11 +627,14 @@ static void wait_for_vchan_client_with_timeout(libvchan_t *conn, int timeout) { FD_SET(fd, &rdset); switch (select(fd+1, &rdset, NULL, NULL, &timeout_tv)) { case -1: - if (errno == EINTR) + if (errno == EINTR) { break; - /* fallthough */ + } + fprintf(stderr, "vchan connection error\n"); + libvchan_close(conn); + do_exit(1); case 0: - fprintf(stderr, "vchan connection timeout (or error)\n"); + fprintf(stderr, "vchan connection timeout\n"); libvchan_close(conn); do_exit(1); }