Diff for /rpl/src/rpl.c between versions 1.179 and 1.188

version 1.179, 2016/03/16 11:11:10 version 1.188, 2016/10/11 11:57:02
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.25    RPL/2 (R) version 4.1.26
   Copyright (C) 1989-2016 Dr. BERTRAND Joël    Copyright (C) 1989-2016 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
Line 27 Line 27
 #pragma GCC diagnostic push  #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wclobbered"  #pragma GCC diagnostic ignored "-Wclobbered"
   
   #ifdef BROKEN_SIGSEGV
   #   undef HAVE_STACK_OVERFLOW_RECOVERY
   #   undef HAVE_SIGSEGV_RECOVERY
   #endif
   
   
 /*  /*
 ================================================================================  ================================================================================
Line 123  rplinit(int argc, char *argv[], char *en Line 128  rplinit(int argc, char *argv[], char *en
     errno = 0;      errno = 0;
     s_queue_signaux = NULL;      s_queue_signaux = NULL;
     routine_recursive = 0;      routine_recursive = 0;
       nombre_thread_surveillance_processus = 0;
     pid_processus_pere = getpid();      pid_processus_pere = getpid();
   
   #   ifdef DEBUG_PROC
       __proc = 0;
   #   endif
   
 #   ifdef DEBUG_MEMOIRE  #   ifdef DEBUG_MEMOIRE
     debug_memoire_initialisation();      debug_memoire_initialisation();
 #   endif  #   endif
Line 514  rplinit(int argc, char *argv[], char *en Line 524  rplinit(int argc, char *argv[], char *en
         }          }
 #   endif  #   endif
   
     if (lancement_thread_signaux(s_etat_processus) != d_absence_erreur)  
     {  
 #       ifndef SEMAPHORES_NOMMES  
             sem_post(&((*s_etat_processus).semaphore_fork));  
             sem_destroy(&((*s_etat_processus).semaphore_fork));  
 #       else  
             sem_post((*s_etat_processus).semaphore_fork);  
             sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),  
                     pthread_self(), SEM_FORK);  
 #       endif  
   
         liberation_contexte_cas(s_etat_processus);  
         destruction_queue_signaux(s_etat_processus);  
   
 #       ifdef HAVE_STACK_OVERFLOW_RECOVERY  
             stackoverflow_deinstall_handler();  
 #       endif  
   
         erreur = d_es_signal;  
   
         if ((*s_etat_processus).langue == 'F')  
         {  
             printf("+++Système : Initialisation des signaux POSIX "  
                     "impossible\n");  
         }  
         else  
         {  
             printf("+++System : Initialization of POSIX signals failed\n");  
         }  
   
         return(EXIT_FAILURE);  
     }  
   
     action.sa_handler = interruption1;      action.sa_handler = interruption1;
     action.sa_flags = 0;      action.sa_flags = 0;
   
Line 704  rplinit(int argc, char *argv[], char *en Line 681  rplinit(int argc, char *argv[], char *en
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     if (sigaction(SIGALRM, &action, NULL) != 0)      if (sigaction(SIGUSR2, &action, NULL) != 0)
     {      {
 #       ifndef SEMAPHORES_NOMMES  #       ifndef SEMAPHORES_NOMMES
             sem_post(&((*s_etat_processus).semaphore_fork));              sem_post(&((*s_etat_processus).semaphore_fork));
Line 738  rplinit(int argc, char *argv[], char *en Line 715  rplinit(int argc, char *argv[], char *en
     }      }
   
     signal_test = SIGTEST;      signal_test = SIGTEST;
     raise(SIGALRM);      raise(SIGUSR2);
   
     attente.tv_sec = 0;      attente.tv_sec = 0;
     attente.tv_nsec = 1000000;      attente.tv_nsec = 1000000;
Line 748  rplinit(int argc, char *argv[], char *en Line 725  rplinit(int argc, char *argv[], char *en
         nanosleep(&attente, NULL);          nanosleep(&attente, NULL);
     }      }
   
     if (signal_test != SIGALRM)      if (signal_test != SIGUSR2)
     {      {
 #       ifndef SEMAPHORES_NOMMES  #       ifndef SEMAPHORES_NOMMES
             sem_post(&((*s_etat_processus).semaphore_fork));              sem_post(&((*s_etat_processus).semaphore_fork));
Line 2480  rplinit(int argc, char *argv[], char *en Line 2457  rplinit(int argc, char *argv[], char *en
   
         if (debug == d_faux)          if (debug == d_faux)
         {          {
 #   ifdef HAVE_SIGSEGV_RECOVERY  #   if defined(HAVE_SIGSEGV_RECOVERY)
             if (sigsegv_install_handler(interruption_violation_access) != 0)              if (sigsegv_install_handler(interruption_violation_access) != 0)
             {              {
 #               ifndef SEMAPHORES_NOMMES  #               ifndef SEMAPHORES_NOMMES
Line 4990  rplinit(int argc, char *argv[], char *en Line 4967  rplinit(int argc, char *argv[], char *en
                                         (*(*((struct_processus_fils *)                                          (*(*((struct_processus_fils *)
                                         (*(*((struct_liste_chainee *)                                          (*(*((struct_liste_chainee *)
                                         l_element_courant)).donnee).objet))                                          l_element_courant)).donnee).objet))
                                         .thread).pid, rpl_sigurg);                                          .thread).pid, rpl_sigurg, d_faux);
                             }                              }
                             else                              else
                             {                              {
Line 5001  rplinit(int argc, char *argv[], char *en Line 4978  rplinit(int argc, char *argv[], char *en
                                             (*(*((struct_processus_fils *)                                              (*(*((struct_processus_fils *)
                                             (*(*((struct_liste_chainee *)                                              (*(*((struct_liste_chainee *)
                                             l_element_courant)).donnee).objet))                                              l_element_courant)).donnee).objet))
                                             .thread).pid, rpl_sigabort);                                              .thread).pid, rpl_sigabort, d_faux);
                                 }                                  }
                                 else                                  else
                                 {                                  {
Line 5009  rplinit(int argc, char *argv[], char *en Line 4986  rplinit(int argc, char *argv[], char *en
                                             (*(*((struct_processus_fils *)                                              (*(*((struct_processus_fils *)
                                             (*(*((struct_liste_chainee *)                                              (*(*((struct_liste_chainee *)
                                             l_element_courant)).donnee).objet))                                              l_element_courant)).donnee).objet))
                                             .thread).pid, rpl_sigstop);                                              .thread).pid, rpl_sigstop, d_faux);
                                 }                                  }
                             }                              }
                         }                          }
Line 5729  rplinit(int argc, char *argv[], char *en Line 5706  rplinit(int argc, char *argv[], char *en
   
     retrait_thread(s_etat_processus);      retrait_thread(s_etat_processus);
   
       attente.tv_sec = 0;
       attente.tv_nsec = GRANULARITE_us * 1000;
   
       while(nombre_thread_surveillance_processus != 0)
       {
           nanosleep(&attente, NULL);
           INCR_GRANULARITE(attente.tv_nsec);
       }
   
     pthread_mutex_destroy(&((*s_etat_processus).mutex_pile_processus));      pthread_mutex_destroy(&((*s_etat_processus).mutex_pile_processus));
     pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation));      pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation));
     pthread_mutex_destroy(&((*s_etat_processus).mutex_interruptions));      pthread_mutex_destroy(&((*s_etat_processus).mutex_interruptions));
Line 5762  rplinit(int argc, char *argv[], char *en Line 5748  rplinit(int argc, char *argv[], char *en
         erreur = d_erreur;          erreur = d_erreur;
     }      }
   
     sys_free(arg_exec);  
     liberation_etat_processus_readline();      liberation_etat_processus_readline();
   
     liberation_allocateur_buffer(s_etat_processus);      liberation_allocateur_buffer(s_etat_processus);
     pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation_buffer));      pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation_buffer));
   
     sys_free(s_etat_processus);      sys_free(s_etat_processus);
       sys_free(arg_exec);
   
 #   ifdef DEBUG_MEMOIRE  #   ifdef DEBUG_MEMOIRE
     debug_memoire_verification();      debug_memoire_verification();

Removed from v.1.179  
changed lines
  Added in v.1.188


CVSweb interface <joel.bertrand@systella.fr>