X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.cpp;h=6a61812e8b927d5cfad461961ef8ceb185b7d895;hb=de93dc84bc5f050272e4e736c3afa6ad5f3c6654;hp=e9f5fcb1caac0a161bc510ab1cb62db6bdd71bd1;hpb=7ac877ea57663a02e9042939aa51eb700fbe4301;p=kdenlive diff --git a/src/jogshuttle.cpp b/src/jogshuttle.cpp index e9f5fcb1..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) { @@ -332,3 +334,5 @@ void JogShuttle::customEvent(QEvent* e) // #include "jogshuttle.moc" + +#include "jogshuttle.moc"