mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-24 17:06:25 -05:00
Secure external tools execution
This commit is contained in:
parent
084ced8699
commit
a33e048a4b
9 changed files with 571 additions and 80 deletions
|
|
@ -7,6 +7,31 @@
|
|||
|
||||
#include "support.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* signal */
|
||||
|
||||
volatile int global_interrupt = 0;
|
||||
|
||||
int os_global_interrupt(void)
|
||||
{
|
||||
return global_interrupt;
|
||||
}
|
||||
|
||||
static void signal_handler(int signum)
|
||||
{
|
||||
/* report the request of interruption with the signal received */
|
||||
global_interrupt = signum;
|
||||
}
|
||||
|
||||
void os_signal_init(void)
|
||||
{
|
||||
signal(SIGTERM, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* os */
|
||||
|
||||
/**
|
||||
* Exit codes.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue