-rw-r--r-- | noncore/apps/opie-console/filereceive.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.cpp | 2 |
2 files changed, 2 insertions, 2 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 | } |
110 | void FileReceive::cancel() { | 110 | void FileReceive::cancel() { |
111 | ::kill(m_pid, 9 ); | 111 | ::kill(m_pid, 9 ); |
112 | } | 112 | } |
113 | void FileReceive::setupChild() { | 113 | void 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 | } |
140 | void FileReceive::slotRead() { | 140 | void 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 ); |
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index 221838c..5144941 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp | |||
@@ -120,49 +120,49 @@ void FileTransfer::sendFile( const QString& file ) { | |||
120 | } | 120 | } |
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | } | 123 | } |
124 | /* | 124 | /* |
125 | * let's call the one with the filename | 125 | * let's call the one with the filename |
126 | */ | 126 | */ |
127 | void FileTransfer::sendFile( const QFile& file ) { | 127 | void FileTransfer::sendFile( const QFile& file ) { |
128 | sendFile( file.name() ); | 128 | sendFile( file.name() ); |
129 | } | 129 | } |
130 | 130 | ||
131 | /* | 131 | /* |
132 | * setting up communication | 132 | * setting up communication |
133 | * between parent child and ioLayer | 133 | * between parent child and ioLayer |
134 | */ | 134 | */ |
135 | void FileTransfer::setupChild() { | 135 | void FileTransfer::setupChild() { |
136 | /* | 136 | /* |
137 | * we do not want to read from our | 137 | * we do not want to read from our |
138 | * information channel | 138 | * information channel |
139 | */ | 139 | */ |
140 | if (m_info[0] ) | 140 | if (m_info[0] ) |
141 | close(m_info[0] ); | 141 | close(m_info[0] ); |
142 | /* | 142 | /* |
143 | * FD_CLOEXEC will close the | 143 | * FD_CLOEXEC will close the |
144 | * fd on successfull exec | 144 | * fd on successful exec |
145 | */ | 145 | */ |
146 | if (m_info[1] ) | 146 | if (m_info[1] ) |
147 | fcntl(m_info[1], F_SETFD, FD_CLOEXEC ); | 147 | fcntl(m_info[1], F_SETFD, FD_CLOEXEC ); |
148 | 148 | ||
149 | if (m_comm[0] ) | 149 | if (m_comm[0] ) |
150 | close( m_comm[0] ); | 150 | close( m_comm[0] ); |
151 | /* | 151 | /* |
152 | * now set the communication | 152 | * now set the communication |
153 | * m_fd STDIN_FILENO | 153 | * m_fd STDIN_FILENO |
154 | * STDOUT_FILENO | 154 | * STDOUT_FILENO |
155 | * STDERR_FILENO | 155 | * STDERR_FILENO |
156 | */ | 156 | */ |
157 | dup2( m_fd, STDIN_FILENO ); | 157 | dup2( m_fd, STDIN_FILENO ); |
158 | dup2( m_fd, STDOUT_FILENO ); | 158 | dup2( m_fd, STDOUT_FILENO ); |
159 | dup2( m_comm[1], STDERR_FILENO ); | 159 | dup2( m_comm[1], STDERR_FILENO ); |
160 | } | 160 | } |
161 | 161 | ||
162 | /* | 162 | /* |
163 | * read from the stderr of the child | 163 | * read from the stderr of the child |
164 | * process | 164 | * process |
165 | */ | 165 | */ |
166 | void FileTransfer::slotRead() { | 166 | void FileTransfer::slotRead() { |
167 | QByteArray ar(4096); | 167 | QByteArray ar(4096); |
168 | int len = read(m_comm[0], ar.data(), 4096 ); | 168 | int len = read(m_comm[0], ar.data(), 4096 ); |