From 1aeccfdc39ae6a41f76c4dbe552e74d64957701a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Sat, 7 Mar 2009 17:51:31 +0000 Subject: [PATCH] [PATCH by Ray Lehtiniemi] Check return code on read() syscall. svn path=/trunk/kdenlive/; revision=3106 --- src/jogshuttle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jogshuttle.cpp b/src/jogshuttle.cpp index 1b6df679..152b00fb 100644 --- a/src/jogshuttle.cpp +++ b/src/jogshuttle.cpp @@ -97,7 +97,9 @@ void ShuttleThread::run() { } while (!stop_me) { - read(fd, &ev, sizeof(ev)); + if (read(fd, &ev, sizeof(ev)) < 0) { + fprintf(stderr, "Failed to read event from Jog Shuttle FILE DESCRIPTOR\n"); + } handle_event(ev); } close(fd); -- 2.39.2