diff --git a/mythtv/libs/libmythtv/fileringbuffer.cpp b/mythtv/libs/libmythtv/fileringbuffer.cpp
index a7d7eee..5d3aea4 100644
a
|
b
|
FileRingBuffer::FileRingBuffer(const QString &lfilename, |
69 | 69 | else |
70 | 70 | { |
71 | 71 | tfw = new ThreadedFileWriter( |
72 | | filename, O_WRONLY|O_TRUNC|O_CREAT|O_LARGEFILE, 0644); |
| 72 | filename, O_WRONLY|O_TRUNC|O_CREAT|O_LARGEFILE|O_NONBLOCK, 0644); |
73 | 73 | |
74 | 74 | if (!tfw->Open()) |
75 | 75 | { |
… |
… |
bool FileRingBuffer::OpenFile(const QString &lfilename, uint retry_ms) |
221 | 221 | lasterror = 0; |
222 | 222 | |
223 | 223 | fd2 = open(filename.toLocal8Bit().constData(), |
224 | | O_RDONLY|O_LARGEFILE|O_STREAMING|O_BINARY); |
| 224 | O_NONBLOCK|O_RDONLY|O_LARGEFILE|O_STREAMING|O_BINARY); |
225 | 225 | |
226 | 226 | if (fd2 < 0) |
227 | 227 | { |
… |
… |
int FileRingBuffer::safe_read(int fd, void *data, uint sz) |
460 | 460 | uint toread = sz - tot; |
461 | 461 | bool read_ok = true; |
462 | 462 | bool eof = false; |
| 463 | |
463 | 464 | |
464 | 465 | // check that we have some data to read, |
465 | 466 | // so we never attempt to read past the end of file |
466 | 467 | // if fstat errored or isn't a regular file, default to previous behavior |
| 468 | /* |
467 | 469 | ret = fstat(fd2, &sb); |
468 | 470 | if (ret == 0 && S_ISREG(sb.st_mode)) |
469 | 471 | { |
… |
… |
int FileRingBuffer::safe_read(int fd, void *data, uint sz) |
487 | 489 | } |
488 | 490 | } |
489 | 491 | } |
490 | | |
491 | 492 | if (read_ok) |
492 | 493 | { |
| 494 | */ |
493 | 495 | LOG(VB_FILE, LOG_DEBUG, LOC + |
494 | 496 | QString("read(%1) -- begin").arg(toread)); |
495 | 497 | ret = read(fd2, (char *)data + tot, toread); |
496 | 498 | LOG(VB_FILE, LOG_DEBUG, LOC + |
497 | 499 | QString("read(%1) -> %2 end").arg(toread).arg(ret)); |
498 | | } |
| 500 | // } |
499 | 501 | if (ret < 0) |
500 | 502 | { |
501 | 503 | if (errno == EAGAIN) |
… |
… |
int FileRingBuffer::safe_read(int fd, void *data, uint sz) |
516 | 518 | |
517 | 519 | if (oldfile) |
518 | 520 | break; |
519 | | |
| 521 | /* |
520 | 522 | if (eof) |
521 | 523 | { |
522 | 524 | // we can exit now, if file is still open for writing in another |
523 | 525 | // instance, RingBuffer will retry |
524 | 526 | break; |
525 | 527 | } |
526 | | |
| 528 | */ |