summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/filetransfer.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/filetransfer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/filetransfer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp
index 7eebc65..6e2d2d5 100644
--- a/noncore/apps/opie-console/filetransfer.cpp
+++ b/noncore/apps/opie-console/filetransfer.cpp
@@ -1,18 +1,19 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <errno.h> 3#include <errno.h>
4#include <fcntl.h> 4#include <fcntl.h>
5#include <unistd.h> 5#include <unistd.h>
6 6
7#include <opie2/odebug.h>
7#include <qsocketnotifier.h> 8#include <qsocketnotifier.h>
8 9
9#include "procctl.h" 10#include "procctl.h"
10#include "filetransfer.h" 11#include "filetransfer.h"
11 12
12 13
13FileTransfer::FileTransfer( Type t, IOLayer* lay ) 14FileTransfer::FileTransfer( Type t, IOLayer* lay )
14 : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { 15 : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) {
15 signal(SIGPIPE, SIG_IGN ); 16 signal(SIGPIPE, SIG_IGN );
16 17
17 m_pid = 0; 18 m_pid = 0;
18 m_not = 0l; 19 m_not = 0l;
@@ -225,24 +226,25 @@ void FileTransfer::slotProgress( const QStringList& list ) {
225 if ( prog > m_prog ) { 226 if ( prog > m_prog ) {
226 m_prog = prog; 227 m_prog = prog;
227 emit progress(m_file, m_prog, bps, -1, min , sec ); 228 emit progress(m_file, m_prog, bps, -1, min , sec );
228 } 229 }
229 230
230} 231}
231void FileTransfer::cancel() { 232void FileTransfer::cancel() {
232 if(m_pid > 0) ::kill(m_pid,9 ); 233 if(m_pid > 0) ::kill(m_pid,9 );
233 234
234} 235}
235void FileTransfer::slotExec() { 236void FileTransfer::slotExec() {
236 char buf[2]; 237 char buf[2];
237 ::read(m_term[0], buf, 1 ); 238 if (::read(m_term[0], buf, 1 ) == -1)
239 owarn << "read of m_term[0] failed" << oendl;
238 delete m_proc; 240 delete m_proc;
239 delete m_not; 241 delete m_not;
240 m_proc = m_not = 0l; 242 m_proc = m_not = 0l;
241 close( m_term[0] ); 243 close( m_term[0] );
242 close( m_term[1] ); 244 close( m_term[1] );
243 close( m_comm[0] ); 245 close( m_comm[0] );
244 close( m_comm[1] ); 246 close( m_comm[1] );
245 layer()->closeRawIO( m_fd ); 247 layer()->closeRawIO( m_fd );
246 emit sent(); 248 emit sent();
247 m_pid = 0; 249 m_pid = 0;
248} 250}