X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/052e5ec5f3bff8d624bd133ad72921240b4d319e..8ba80c6f8325e61de2e3fc4bbd7cf3d750f432cd:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 0d1cf55045..9a1243beb7 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -266,10 +266,12 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags) } // Shutdown or reboot the PC -bool wxShutdown(wxShutdownFlags wFlags) +bool wxShutdown(int flags) { + flags &= ~wxSHUTDOWN_FORCE; + wxChar level; - switch ( wFlags ) + switch ( flags ) { case wxSHUTDOWN_POWEROFF: level = _T('0'); @@ -279,12 +281,16 @@ bool wxShutdown(wxShutdownFlags wFlags) level = _T('6'); break; + case wxSHUTDOWN_LOGOFF: + // TODO: use dcop to log off? + return false; + default: wxFAIL_MSG( _T("unknown wxShutdown() flag") ); return false; } - return system(wxString::Format(_T("init %c"), level).mb_str()) == 0; + return system(wxString::Format("init %c", level).mb_str()) == 0; } // ---------------------------------------------------------------------------- @@ -1303,7 +1309,7 @@ private: DECLARE_NO_COPY_CLASS(wxEndHandler) }; -#if wxUSE_STREAMS +#if HAS_PIPE_INPUT_STREAM // class for monitoring our ends of child stdout/err, should be constructed // with the FD and stream from wxExecuteData and will do nothing if they're @@ -1332,7 +1338,7 @@ private: DECLARE_NO_COPY_CLASS(wxRedirectedIOHandler) }; -#endif // wxUSE_STREAMS +#endif // HAS_PIPE_INPUT_STREAM // helper function which calls waitpid() and analyzes the result int DoWaitForChild(int pid, int flags = 0) @@ -1407,7 +1413,7 @@ int wxAppTraits::WaitForChild(wxExecuteData& execData) } //else: synchronous execution case -#if wxUSE_STREAMS +#if HAS_PIPE_INPUT_STREAM wxProcess * const process = execData.process; if ( process && process->IsRedirected() ) { @@ -1431,7 +1437,7 @@ int wxAppTraits::WaitForChild(wxExecuteData& execData) } } //else: no IO redirection, just block waiting for the child to exit -#endif // wxUSE_STREAMS +#endif // HAS_PIPE_INPUT_STREAM return DoWaitForChild(execData.pid); }