-rw-r--r-- | noncore/apps/opie-console/filetransfer.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index 97552fe..b39dc95 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp @@ -44,34 +44,47 @@ void FileTransfer::sendFile( const QString& file ) { m_info[0] = m_info[1] = 0; m_pid = fork(); switch( m_pid ) { case -1: emit error( StartError, tr("Was not able to fork") ); break; case 0:{ setupChild(); qWarning("output:"+file ); /* exec */ char* verbose = "-vv"; char* binray = "-b"; + char* typus; + switch(m_type ) { + case SZ: + typus = ""; + break; + case SX: + typus = "-X"; + break; + case SY: + typus = "--ymodem"; + break; + } + /* we should never return from here */ - execlp("sz", "sz", verbose, binray, file.latin1(), NULL ); + execlp("sz", "sz", verbose, binray, file.latin1(), typus, NULL ); /* communication for error!*/ char resultByte =1; if (m_info[1] ) write(m_info[1], &resultByte, 1 ); _exit( -1 ); break; } default:{ if ( m_info[1] ) close( m_info[1] ); if ( m_info[0] ) for (;;) { char resultByte; int len; len = read(m_info[0], &resultByte, 1 ); /* len == 1 start up failed */ if ( len == 1 ) { |