summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/filereceive.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/filereceive.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/filereceive.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/filereceive.cpp b/noncore/apps/opie-console/filereceive.cpp
index e387273..452be60 100644
--- a/noncore/apps/opie-console/filereceive.cpp
+++ b/noncore/apps/opie-console/filereceive.cpp
@@ -99,49 +99,49 @@ void FileReceive::receive( const QString& dir ) {
99 ProcCtl::self()->add(m_pid, m_term[1] ); 99 ProcCtl::self()->add(m_pid, m_term[1] );
100 m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read ); 100 m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read );
101 connect(m_proc, SIGNAL(activated(int) ), 101 connect(m_proc, SIGNAL(activated(int) ),
102 this, SLOT(slotExec() ) ); 102 this, SLOT(slotExec() ) );
103 103
104 } 104 }
105 break; 105 break;
106 106
107 } 107 }
108 108
109} 109}
110void FileReceive::cancel() { 110void FileReceive::cancel() {
111 ::kill(m_pid, 9 ); 111 ::kill(m_pid, 9 );
112} 112}
113void FileReceive::setupChild() { 113void FileReceive::setupChild() {
114 changeDir( currentDir() ); 114 changeDir( currentDir() );
115 /* 115 /*
116 * we do not want to read from our 116 * we do not want to read from our
117 * information channel 117 * information channel
118 */ 118 */
119 if (m_info[0] ) 119 if (m_info[0] )
120 close(m_info[0] ); 120 close(m_info[0] );
121 /* 121 /*
122 * FD_CLOEXEC will close the 122 * FD_CLOEXEC will close the
123 * fd on successfull exec 123 * fd on successful exec
124 */ 124 */
125 if (m_info[1] ) 125 if (m_info[1] )
126 fcntl(m_info[1], F_SETFD, FD_CLOEXEC ); 126 fcntl(m_info[1], F_SETFD, FD_CLOEXEC );
127 127
128 if (m_comm[0] ) 128 if (m_comm[0] )
129 close( m_comm[0] ); 129 close( m_comm[0] );
130 /* 130 /*
131 * now set the communication 131 * now set the communication
132 * m_fd STDIN_FILENO 132 * m_fd STDIN_FILENO
133 * STDOUT_FILENO 133 * STDOUT_FILENO
134 * STDERR_FILENO 134 * STDERR_FILENO
135 */ 135 */
136 dup2( m_fd, STDIN_FILENO ); 136 dup2( m_fd, STDIN_FILENO );
137 dup2( m_fd, STDOUT_FILENO ); 137 dup2( m_fd, STDOUT_FILENO );
138 dup2( m_comm[1], STDERR_FILENO ); 138 dup2( m_comm[1], STDERR_FILENO );
139} 139}
140void FileReceive::slotRead() { 140void FileReceive::slotRead() {
141 QByteArray ar(4096); 141 QByteArray ar(4096);
142 int len = read(m_comm[0], ar.data(), 4096 ); 142 int len = read(m_comm[0], ar.data(), 4096 );
143 for (int i = 0; i < len; i++ ) { 143 for (int i = 0; i < len; i++ ) {
144 // printf("%c", ar[i] ); 144 // printf("%c", ar[i] );
145 } 145 }
146 ar.resize( len ); 146 ar.resize( len );
147 QString str( ar ); 147 QString str( ar );