summaryrefslogtreecommitdiff
path: root/core/opie-login/main.cpp
Unidiff
Diffstat (limited to 'core/opie-login/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 7d5792e..8d0976f 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -126,97 +126,97 @@ int main ( int argc, char **argv )
126 126
127 if (( ::time ( 0 ) - started ) < 3 ) { 127 if (( ::time ( 0 ) - started ) < 3 ) {
128 if ( autolog ) { 128 if ( autolog ) {
129 ::syslog ( LOG_ERR, "Respawning too fast -- disabling auto-login\n" ); 129 ::syslog ( LOG_ERR, "Respawning too fast -- disabling auto-login\n" );
130 autolog = 0; 130 autolog = 0;
131 } 131 }
132 else { 132 else {
133 ::syslog ( LOG_ERR, "Respawning too fast -- going down\n" ); 133 ::syslog ( LOG_ERR, "Respawning too fast -- going down\n" );
134 break; 134 break;
135 } 135 }
136 } 136 }
137 int killedbysig = 0; 137 int killedbysig = 0;
138 userExited=0; 138 userExited=0;
139 if (WIFEXITED(status)!=0 ) { 139 if (WIFEXITED(status)!=0 ) {
140 if (WEXITSTATUS(status)==137) { 140 if (WEXITSTATUS(status)==137) {
141 userExited=1; 141 userExited=1;
142 } 142 }
143 } 143 }
144 144
145 if ( WIFSIGNALED( status )) { 145 if ( WIFSIGNALED( status )) {
146 switch ( WTERMSIG( status )) { 146 switch ( WTERMSIG( status )) {
147 case SIGTERM: 147 case SIGTERM:
148 case SIGINT : 148 case SIGINT :
149 case SIGKILL: 149 case SIGKILL:
150 break; 150 break;
151 151
152 default : 152 default :
153 killedbysig = WTERMSIG( status ); 153 killedbysig = WTERMSIG( status );
154 break; 154 break;
155 } 155 }
156 } 156 }
157 if ( killedbysig ) { // qpe was killed by an uncaught signal 157 if ( killedbysig ) { // qpe was killed by an uncaught signal
158 qApp = 0; 158 qApp = 0;
159 159
160 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig ); 160 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig );
161 161
162 QWSServer::setDesktopBackground ( QImage ( )); 162 QWSServer::setDesktopBackground ( QImage ( ));
163 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer ); 163 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer );
164 app-> setFont ( QFont ( "Helvetica", 10 )); 164 app-> setFont ( QFont ( "Helvetica", 10 ));
165 app-> setStyle ( new QPEStyle ( )); 165 app-> setStyle ( new QPEStyle ( ));
166 166
167 const char *sig = ::strsignal ( killedbysig ); 167 const char *sig = ::strsignal ( killedbysig );
168 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); 168 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
169 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); 169 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig ));
170 l-> setAlignment ( Qt::AlignCenter ); 170 l-> setAlignment ( Qt::AlignCenter );
171 l-> move ( 0, 0 ); 171 l-> move ( 0, 0 );
172 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); 172 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
173 l-> show ( ); 173 l-> show ( );
174 QTimer::singleShot ( 3000, app, SLOT( quit ( ))); 174 QTimer::singleShot ( 3000, app, SLOT( quit()));
175 app-> exec ( ); 175 app-> exec ( );
176 delete app; 176 delete app;
177 qApp = 0; 177 qApp = 0;
178 } 178 }
179 } 179 }
180 else { 180 else {
181 if ( !autolog ) { 181 if ( !autolog ) {
182 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; 182 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf";
183 Config cfg ( confFile, Config::File ); 183 Config cfg ( confFile, Config::File );
184 cfg. setGroup ( "General" ); 184 cfg. setGroup ( "General" );
185 QString user = cfg. readEntry ( "AutoLogin" ); 185 QString user = cfg. readEntry ( "AutoLogin" );
186 186
187 if ( !user. isEmpty ( )) 187 if ( !user. isEmpty ( ))
188 autolog = ::strdup ( user. latin1 ( )); 188 autolog = ::strdup ( user. latin1 ( ));
189 } 189 }
190 190
191 if ( autolog && !userExited ) { 191 if ( autolog && !userExited ) {
192 192
193 QWSServer::setDesktopBackground( QImage() ); 193 QWSServer::setDesktopBackground( QImage() );
194 ODevice::inst ( )-> setDisplayStatus ( true ); 194 ODevice::inst ( )-> setDisplayStatus ( true );
195 ODevice::inst ( )-> setSoftSuspend ( false ); 195 ODevice::inst ( )-> setSoftSuspend ( false );
196 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 196 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
197 LoginApplication::setLoginAs ( autolog ); 197 LoginApplication::setLoginAs ( autolog );
198 198
199 199
200 if ( LoginApplication::changeIdentity ( )) 200 if ( LoginApplication::changeIdentity ( ))
201 ::exit ( LoginApplication::login ( )); 201 ::exit ( LoginApplication::login ( ));
202 else 202 else
203 ::exit ( 0 ); 203 ::exit ( 0 );
204 } 204 }
205 else { 205 else {
206 ::exit ( login_main ( argc, argv, ppid )); 206 ::exit ( login_main ( argc, argv, ppid ));
207 } 207 }
208 } 208 }
209 } 209 }
210 return 0; 210 return 0;
211} 211}
212 212
213void sigterm ( int /*sig*/ ) 213void sigterm ( int /*sig*/ )
214{ 214{
215 ::exit ( 0 ); 215 ::exit ( 0 );
216} 216}
217 217
218 218
219void exit_closelog ( ) 219void exit_closelog ( )
220{ 220{
221 ::closelog ( ); 221 ::closelog ( );
222} 222}