-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index 2570826..534f79a 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp | |||
@@ -124,49 +124,49 @@ void MyPty::donePty() | |||
124 | } | 124 | } |
125 | 125 | ||
126 | m_cpid = 0; | 126 | m_cpid = 0; |
127 | m_fd = -1; | 127 | m_fd = -1; |
128 | // emit done(status); | 128 | // emit done(status); |
129 | } | 129 | } |
130 | 130 | ||
131 | 131 | ||
132 | const char* MyPty::deviceName() | 132 | const char* MyPty::deviceName() |
133 | { | 133 | { |
134 | return m_ttynam; | 134 | return m_ttynam; |
135 | } | 135 | } |
136 | 136 | ||
137 | 137 | ||
138 | void MyPty::error() | 138 | void MyPty::error() |
139 | { | 139 | { |
140 | // This is code from the Qt DumbTerminal example | 140 | // This is code from the Qt DumbTerminal example |
141 | donePty(); | 141 | donePty(); |
142 | } | 142 | } |
143 | 143 | ||
144 | void MyPty::start() { | 144 | void MyPty::start() { |
145 | char* cmd = "/bin/sh"; | 145 | char* cmd = "/bin/sh"; |
146 | 146 | ||
147 | if ( QFile::exists( "/bin/bash" ) ) { | 147 | if ( QFile::exists( "/bin/bash" ) ) { |
148 | char* cmd = "/bin/bash"; | 148 | cmd = "/bin/bash"; |
149 | } | 149 | } |
150 | 150 | ||
151 | QStrList lis; | 151 | QStrList lis; |
152 | int r =run(cmd, lis, 0, 0); | 152 | int r =run(cmd, lis, 0, 0); |
153 | r = r; | 153 | r = r; |
154 | } | 154 | } |
155 | /*! | 155 | /*! |
156 | start the client program. | 156 | start the client program. |
157 | */ | 157 | */ |
158 | int MyPty::run(const char* cmd, QStrList &, const char*, int) | 158 | int MyPty::run(const char* cmd, QStrList &, const char*, int) |
159 | { | 159 | { |
160 | // This is code from the Qt DumbTerminal example | 160 | // This is code from the Qt DumbTerminal example |
161 | m_cpid = fork(); | 161 | m_cpid = fork(); |
162 | 162 | ||
163 | if ( !m_cpid ) { | 163 | if ( !m_cpid ) { |
164 | // child - exec shell on tty | 164 | // child - exec shell on tty |
165 | for (int sig = 1; sig < NSIG; sig++) signal(sig,SIG_DFL); | 165 | for (int sig = 1; sig < NSIG; sig++) signal(sig,SIG_DFL); |
166 | int ttyfd = ::open(m_ttynam, O_RDWR); | 166 | int ttyfd = ::open(m_ttynam, O_RDWR); |
167 | dup2(ttyfd, STDIN_FILENO); | 167 | dup2(ttyfd, STDIN_FILENO); |
168 | dup2(ttyfd, STDOUT_FILENO); | 168 | dup2(ttyfd, STDOUT_FILENO); |
169 | dup2(ttyfd, STDERR_FILENO); | 169 | dup2(ttyfd, STDERR_FILENO); |
170 | // should be done with tty, so close it | 170 | // should be done with tty, so close it |
171 | ::close(ttyfd); | 171 | ::close(ttyfd); |
172 | static struct termios ttmode; | 172 | static struct termios ttmode; |