mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 19:25:51 +00:00
Consolidate Process::terminate code
This commit is contained in:
@@ -57,12 +57,6 @@ void Process::setPriority (ProcessPriority prior)
|
||||
pthread_setschedparam (pthread_self(), policy, ¶m);
|
||||
}
|
||||
|
||||
void Process::terminate()
|
||||
{
|
||||
// TODO
|
||||
exit (0);
|
||||
}
|
||||
|
||||
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -47,12 +47,6 @@ void Process::setPriority (const ProcessPriority prior)
|
||||
pthread_setschedparam (pthread_self(), policy, ¶m);
|
||||
}
|
||||
|
||||
void Process::terminate()
|
||||
{
|
||||
// http://www.unix.com/man-page/FreeBSD/2/_exit/
|
||||
::_exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
||||
{
|
||||
// XXX not implemented for FreeBSD!
|
||||
|
||||
@@ -47,12 +47,6 @@ void Process::setPriority (const ProcessPriority prior)
|
||||
pthread_setschedparam (pthread_self(), policy, ¶m);
|
||||
}
|
||||
|
||||
void Process::terminate()
|
||||
{
|
||||
// http://linux.die.net/man/2/_exit
|
||||
::_exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger()
|
||||
{
|
||||
static char testResult = 0;
|
||||
|
||||
@@ -53,12 +53,6 @@ void Process::lowerPrivilege()
|
||||
bassertfalse;
|
||||
}
|
||||
|
||||
void Process::terminate()
|
||||
{
|
||||
// https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/_exit.2.html
|
||||
::_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void Process::setPriority (ProcessPriority)
|
||||
{
|
||||
// xxx
|
||||
|
||||
@@ -148,6 +148,15 @@ void BEAST_CALLTYPE Thread::sleep (int millisecs)
|
||||
nanosleep (&time, nullptr);
|
||||
}
|
||||
|
||||
void Process::terminate()
|
||||
{
|
||||
#if BEAST_ANDROID || BEAST_BSD
|
||||
// http://www.unix.com/man-page/FreeBSD/2/_exit/
|
||||
::_exit (EXIT_FAILURE);
|
||||
#else
|
||||
std::_Exit (EXIT_FAILURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const beast_wchar File::separator = '/';
|
||||
|
||||
Reference in New Issue
Block a user