Add clean_up function, add num_nodes logic to generator, change docs

This commit is contained in:
2019-01-13 13:18:02 +01:00
parent 4d9c62cb84
commit 8c423aaa16
3 changed files with 42 additions and 13 deletions

View File

@@ -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;