leave update plugin with ok button after the update process (we entered it with ok...
[enigma2.git] / lib / base / filepush.cpp
index 17b767f837561f27bf9db000263c5f3ad97a5e4b..cb22ea1b0999abb266f1600a2d8eea51eb90ff4e 100644 (file)
@@ -1,3 +1,4 @@
+#include <config.h>
 #include <lib/base/filepush.h>
 #include <lib/base/eerror.h>
 #include <errno.h>
@@ -6,7 +7,7 @@
 eFilePushThread::eFilePushThread()
 {
        m_stop = 0;
-       m_buf_start = m_buf_end = 0;
+       flush();
 }
 
 static void signal_handler(int x)
@@ -34,12 +35,12 @@ 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);
-                       eDebug("wrote %d bytes", w);
+//                     eDebug("wrote %d bytes", w);
                        if (w <= 0)
                        {
                                if (errno == -EINTR)
                                        continue;
-                               eDebug("eFilePushThread *write error* - not yet handled");
+                               eDebug("eFilePushThread *write error* (%m) - not yet handled");
                                // ... we would stop the thread
                        }
 
@@ -97,9 +98,9 @@ void eFilePushThread::pause()
        stop();
 }
 
-void eFilePushThread::seek(off_t where)
+void eFilePushThread::seek(int whence, off_t where)
 {
-       ::lseek(m_fd_source, where, SEEK_SET);
+       ::lseek(m_fd_source, where, whence);
 }
 
 void eFilePushThread::resume()
@@ -107,3 +108,9 @@ void eFilePushThread::resume()
        m_stop = 0;
        run();
 }
+
+void eFilePushThread::flush()
+{
+       m_buf_start = m_buf_end = 0;
+}
+