Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. CONFIG *config_create_array(CONFIG *pas_head, const unsigned int size)
  2. {
  3.     char log[ECRO_STD_LOG_SIZE];
  4.     pas_head = (CONFIG *) malloc(size * sizeof(CONFIG)); // allocation dymanique
  5.     if (pas_head == NULL) // si tête tableau non vide
  6.     {
  7.         memset(log, '\0', ECRO_STD_LOG_SIZE); // initialisation de la chaine de caractère
  8.         snprintf(log, ECRO_STD_LOG_SIZE, "-d E 1 %s CONFIG type memory allocation failure", ecro_std_prog_name); // élaboration de la trame d'évènement
  9.         write_log(log); // écriture dans les fichiers d'événements
  10.         pthread_mutex_lock(&mutex_main_return); // verrouillage du mutex
  11.         g_main_return = -3;
  12.         pthread_mutex_unlock(&mutex_main_return); // verrouillage du mutex
  13.     }
  14.     config_init_array(pas_head, size);
  15.     return pas_head;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement