Applied styling rules from .clang-format
This commit is contained in:
@@ -18,22 +18,23 @@
|
||||
*/
|
||||
|
||||
#ifdef ZTS_ENABLE_PYTHON
|
||||
/**
|
||||
* In some situations (Python comes to mind) a signal may not make its
|
||||
* way to libzt, for this reason we make sure to define a custom signal
|
||||
* handler that can at least process SIGTERMs
|
||||
*/
|
||||
/**
|
||||
* In some situations (Python comes to mind) a signal may not make its
|
||||
* way to libzt, for this reason we make sure to define a custom signal
|
||||
* handler that can at least process SIGTERMs
|
||||
*/
|
||||
#define ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS 1
|
||||
#endif
|
||||
|
||||
#ifdef ZTS_ENABLE_CUSTOM_SIGNAL_HANDLERS
|
||||
|
||||
#include "ZeroTierSockets.h"
|
||||
#include "Signals.hpp"
|
||||
#include "Signals.hpp"
|
||||
|
||||
#include <signal.h>
|
||||
#include <execinfo.h>
|
||||
#include <cstdlib>
|
||||
#include "ZeroTierSockets.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
|
||||
void _signal_handler(int signal)
|
||||
{
|
||||
@@ -41,24 +42,24 @@ void _signal_handler(int signal)
|
||||
switch(signal)
|
||||
{
|
||||
case SIGINT:
|
||||
fprintf(stderr, "SIGINT\n");
|
||||
break;
|
||||
fprintf(stderr, "SIGINT\n");
|
||||
break;
|
||||
case SIGABRT:
|
||||
fprintf(stderr, "SIGABRT\n");
|
||||
break;
|
||||
fprintf(stderr, "SIGABRT\n");
|
||||
break;
|
||||
case SIGILL:
|
||||
fprintf(stderr, "SIGILL\n");
|
||||
break;
|
||||
fprintf(stderr, "SIGILL\n");
|
||||
break;
|
||||
case SIGSEGV:
|
||||
fprintf(stderr, "SIGSEGV\n");
|
||||
break;
|
||||
fprintf(stderr, "SIGSEGV\n");
|
||||
break;
|
||||
case SIGFPE:
|
||||
fprintf(stderr, "SIGFPE\n");
|
||||
break;
|
||||
fprintf(stderr, "SIGFPE\n");
|
||||
break;
|
||||
case SIGTERM:
|
||||
default:
|
||||
fprintf(stderr, "SIGTERM\n");
|
||||
break;
|
||||
fprintf(stderr, "SIGTERM\n");
|
||||
break;
|
||||
}
|
||||
*/
|
||||
exit(signal);
|
||||
|
||||
Reference in New Issue
Block a user