aboutsummaryrefslogtreecommitdiff
path: root/lib/base/filepush.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-02-02 21:15:16 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-02-02 21:15:16 +0000
commit520a05ac41b69263b5fa3ac3a43ac77a9d759bbc (patch)
tree604f5b4358c9dba7124d19a7ae148eba84a39575 /lib/base/filepush.cpp
parent1491d0aae0f1340a296ad9a764fdf2001f813ad6 (diff)
downloadenigma2-520a05ac41b69263b5fa3ac3a43ac77a9d759bbc.tar.gz
enigma2-520a05ac41b69263b5fa3ac3a43ac77a9d759bbc.zip
continue on EOVERFLOW, use fdatasync every now and then
Diffstat (limited to 'lib/base/filepush.cpp')
-rw-r--r--lib/base/filepush.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/base/filepush.cpp b/lib/base/filepush.cpp
index a955e10b..705dbb5e 100644
--- a/lib/base/filepush.cpp
+++ b/lib/base/filepush.cpp
@@ -27,6 +27,8 @@ void eFilePushThread::thread()
off_t current_span_offset = 0;
size_t current_span_remaining = 0;
+ size_t written_since_last_sync = 0;
+
int already_empty = 0;
eDebug("FILEPUSH THREAD START");
// this is a race. FIXME.
@@ -59,8 +61,16 @@ void eFilePushThread::thread()
/* this should flush all written pages to disk. */
posix_fadvise(m_fd_dest, dest_pos, w, POSIX_FADV_DONTNEED);
-
+
dest_pos += w;
+ written_since_last_sync += w;
+
+ if (written_since_last_sync >= 512*1024)
+ {
+ fdatasync(m_fd_dest);
+ written_since_last_sync = 0;
+ }
+
// printf("FILEPUSH: wrote %d bytes\n", w);
m_buf_start += w;
continue;
@@ -94,7 +104,12 @@ void eFilePushThread::thread()
m_buf_end = 0;
if (errno == EINTR)
continue;
- eDebug("eFilePushThread *read error* - not yet handled");
+ if (errno == EOVERFLOW)
+ {
+ eWarning("OVERFLOW while recording");
+ continue;
+ }
+ eDebug("eFilePushThread *read error* (%m) - not yet handled");
}
if (m_buf_end == 0)
{