X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.cpp;h=6a61812e8b927d5cfad461961ef8ceb185b7d895;hb=2f9294f5de103de1a1a081375470da3571302d06;hp=36ea3cd0fb13dbfa193fe03471c1bdbe814e278c;hpb=8a6e4eb1dea318ecd1c0b313c28b764e89a524c4;p=kdenlive diff --git a/src/jogshuttle.cpp b/src/jogshuttle.cpp index 36ea3cd0..6a61812e 100644 --- a/src/jogshuttle.cpp +++ b/src/jogshuttle.cpp @@ -109,13 +109,15 @@ void ShuttleThread::run() int result, iof = -1; /* get fd settings */ - if ((iof = fcntl(fd, F_GETFL, 0)) != -1) { - /* set fd non blocking */ - fcntl(fd, F_SETFL, iof | O_NONBLOCK); - } else { - fprintf(stderr, "Can't set Jog Shuttle FILE DESCRIPTOR to O_NONBLOCK and stop thread\n"); - return; - } + if ((iof = fcntl(fd, F_GETFL, 0)) == -1) { + fprintf(stderr, "Can't get Jog Shuttle file status\n"); + close(fd); + return; + } else if (fcntl(fd, F_SETFL, iof | O_NONBLOCK) == -1) { + fprintf(stderr, "Can't set Jog Shuttle FILE DESCRIPTOR to O_NONBLOCK and stop thread\n"); + close(fd); + return; + } /* enter thread loop */ while (!stop_me) {