summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Unidiff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 03a23dc..4c239a6 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -20,2 +20,4 @@
20 20
21#include <syslog.h>
22
21#include "desktop.h" 23#include "desktop.h"
@@ -740,8 +742,16 @@ void DesktopApplication::shutdown( ShutdownImpl::Type t )
740{ 742{
743
744 char *opt = 0;
745
741 switch ( t ) { 746 switch ( t ) {
742 case ShutdownImpl::ShutdownSystem: 747 case ShutdownImpl::ShutdownSystem:
743 execlp( "shutdown", "shutdown", "-h", "now", ( void* ) 0 ); 748 opt = "-h";
744 break; 749 // fall through
745 case ShutdownImpl::RebootSystem: 750 case ShutdownImpl::RebootSystem:
746 execlp( "shutdown", "shutdown", "-r", "now", ( void* ) 0 ); 751 if ( opt == 0 )
752 opt = "-r";
753
754 if ( execle( "shutdown", "shutdown", opt, "now", ( void* ) 0, "/sbin", "/usr/sbin", ( void* ) 0 ) < 0 )
755 ::syslog ( LOG_ERR, "Erroring execing shutdown\n" );
756
747 break; 757 break;