The ivtv device open() call is not checked to see if it worked. If it

From: Erik Hovland <erik@hovland.org>

didn't we could be passing -1 to either close or read. Both
bad ideas.
---

 libs/libmythtv/mpegrecorder.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libs/libmythtv/mpegrecorder.cpp b/libs/libmythtv/mpegrecorder.cpp
index 43675db..2746400 100644
--- a/libs/libmythtv/mpegrecorder.cpp
+++ b/libs/libmythtv/mpegrecorder.cpp
@@ -852,6 +852,14 @@ void MpegRecorder::StartRecording(void)
         if (readfd < 0)
             readfd = open(videodevice.ascii(), O_RDWR);
 
+        if (readfd == -1)
+        {
+            VERBOSE(VB_IMPORTANT,
+                    LOC_ERR + QString("Open error on device %1")
+                              .arg(videodevice.ascii()));
+            continue;
+        }
+
         tv.tv_sec = 5;
         tv.tv_usec = 0;
         FD_ZERO(&rdset);
