git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix ScanSetup
[enigma2.git]
/
lib
/
base
/
filepush.cpp
diff --git
a/lib/base/filepush.cpp
b/lib/base/filepush.cpp
index 5ae2f15d7408daf277fe9b34b52241f9a59473fb..17b767f837561f27bf9db000263c5f3ad97a5e4b 100644
(file)
--- a/
lib/base/filepush.cpp
+++ b/
lib/base/filepush.cpp
@@
-34,6
+34,7
@@
void eFilePushThread::thread()
{
// TODO: take care of boundaries.
int w = write(m_fd_dest, m_buffer + m_buf_start, m_buf_end - m_buf_start);
{
// TODO: take care of boundaries.
int w = write(m_fd_dest, m_buffer + m_buf_start, m_buf_end - m_buf_start);
+ eDebug("wrote %d bytes", w);
if (w <= 0)
{
if (errno == -EINTR)
if (w <= 0)
{
if (errno == -EINTR)
@@
-42,6
+43,7
@@
void eFilePushThread::thread()
// ... we would stop the thread
}
// ... we would stop the thread
}
+ /* this should flush all written pages to disk. */
posix_fadvise(m_fd_dest, dest_pos, w, POSIX_FADV_DONTNEED);
dest_pos += w;
posix_fadvise(m_fd_dest, dest_pos, w, POSIX_FADV_DONTNEED);
dest_pos += w;
@@
-80,8
+82,7
@@
void eFilePushThread::start(int fd_source, int fd_dest)
{
m_fd_source = fd_source;
m_fd_dest = fd_dest;
{
m_fd_source = fd_source;
m_fd_dest = fd_dest;
- m_stop = 0;
- run();
+ resume();
}
void eFilePushThread::stop()
}
void eFilePushThread::stop()
@@
-90,3
+91,19
@@
void eFilePushThread::stop()
sendSignal(SIGUSR1);
kill();
}
sendSignal(SIGUSR1);
kill();
}
+
+void eFilePushThread::pause()
+{
+ stop();
+}
+
+void eFilePushThread::seek(off_t where)
+{
+ ::lseek(m_fd_source, where, SEEK_SET);
+}
+
+void eFilePushThread::resume()
+{
+ m_stop = 0;
+ run();
+}