When calling open, you might get a -1 for a file descriptor. Check it
From: Erik Hovland <erik@hovland.org>
before handing the file descriptor off to write().
---
libs/libmythtv/fifowriter.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libs/libmythtv/fifowriter.cpp b/libs/libmythtv/fifowriter.cpp
index 3f4a518..9d6fabe 100644
a
|
b
|
void FIFOWriter::FIFOWriteThread(void) |
141 | 141 | break; |
142 | 142 | if (fd == -1) |
143 | 143 | fd = open(filename[id].ascii(), O_WRONLY| O_SYNC); |
144 | | write(fd, fb_outptr[id]->data, fb_outptr[id]->blksize); |
| 144 | if (fd >= 0) |
| 145 | write(fd, fb_outptr[id]->data, fb_outptr[id]->blksize); |
145 | 146 | pthread_mutex_lock(&fifo_lock[id]); |
146 | 147 | fb_outptr[id] = fb_outptr[id]->next; |
147 | 148 | pthread_cond_signal(&full_cond[id]); |