Add clean_up function, add num_nodes logic to generator, change docs
This commit is contained in:
@@ -24,20 +24,22 @@ typedef struct buffer {
|
||||
} buffer_t;
|
||||
|
||||
static bool terminate = false;
|
||||
static int buffer_shmfd;
|
||||
static buffer_t *circ_buffer;
|
||||
|
||||
/**
|
||||
* @brief Function to execute when the program gets a signal
|
||||
* @details flips the terminate variable to true
|
||||
* @param none
|
||||
* @details Flips the terminate variable to true
|
||||
* @param signo
|
||||
* @return none
|
||||
**/
|
||||
static void signal_handler() {
|
||||
static void signal_handler(int signo) {
|
||||
terminate = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function to process the signals passed by the user
|
||||
* @details creates a new sigaction structure
|
||||
* @details Creates a new sigaction structure
|
||||
* and changes the behaviour of the SIGINT and SIGTERM signals
|
||||
* @param none
|
||||
* @return none
|
||||
@@ -49,5 +51,3 @@ static void process_signal(void){
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
}
|
||||
|
||||
static buffer_t *circ_buffer;
|
||||
|
Reference in New Issue
Block a user