-rw-r--r-- | core/opie-login/loginapplication.cpp | 5 | ||||
-rw-r--r-- | core/opie-login/loginapplication.h | 5 | ||||
-rw-r--r-- | core/opie-login/main.cpp | 11 |
3 files changed, 14 insertions, 7 deletions
diff --git a/core/opie-login/loginapplication.cpp b/core/opie-login/loginapplication.cpp index 103d63b..8d86a71 100644 --- a/core/opie-login/loginapplication.cpp +++ b/core/opie-login/loginapplication.cpp @@ -46,3 +46,3 @@ LoginApplication *lApp; -LoginApplication::LoginApplication ( int &argc, char **argv ) +LoginApplication::LoginApplication ( int &argc, char **argv, pid_t parentpid ) : QPEApplication ( argc, argv, GuiServer ) @@ -50,2 +50,3 @@ LoginApplication::LoginApplication ( int &argc, char **argv ) lApp = this; + m_parentpid = parentpid; } @@ -218,3 +219,3 @@ void LoginApplication::quitToConsole ( ) QPEApplication::quit ( ); - ::kill ( ::getppid ( ), SIGTERM ); + ::kill ( m_parentpid, SIGTERM ); } diff --git a/core/opie-login/loginapplication.h b/core/opie-login/loginapplication.h index 062c088..4e7cf79 100644 --- a/core/opie-login/loginapplication.h +++ b/core/opie-login/loginapplication.h @@ -41,3 +41,3 @@ class LoginApplication : public QPEApplication { public: - LoginApplication ( int &argc, char **argv ); + LoginApplication ( int &argc, char **argv, pid_t parentpid ); @@ -62,2 +62,5 @@ private: #endif + +private: + pid_t m_parentpid; }; diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 579a93a..674829d 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp @@ -62,3 +62,3 @@ using namespace Opie; -int login_main ( int argc, char **argv ); +int login_main ( int argc, char **argv, pid_t ppid ); void sigterm ( int sig ); @@ -74,2 +74,5 @@ int main ( int argc, char **argv ) { + pid_t ppid = ::getpid ( ); + + if ( ::geteuid ( ) != 0 ) { @@ -185,3 +188,3 @@ int main ( int argc, char **argv ) else - ::exit ( login_main ( argc, argv )); + ::exit ( login_main ( argc, argv, ppid )); } @@ -304,6 +307,6 @@ private: -int login_main ( int argc, char **argv ) +int login_main ( int argc, char **argv, pid_t ppid ) { QWSServer::setDesktopBackground( QImage() ); - LoginApplication *app = new LoginApplication ( argc, argv ); + LoginApplication *app = new LoginApplication ( argc, argv, ppid ); |