Diff for /rpl/src/instructions_p7.c between versions 1.79 and 1.80

version 1.79, 2019/02/09 13:36:40 version 1.80, 2019/02/11 09:45:51
Line 752  instruction_poke(struct_processus *s_eta Line 752  instruction_poke(struct_processus *s_eta
                     action.sa_handler = SIG_IGN;                      action.sa_handler = SIG_IGN;
                     action.sa_flags = 0;                      action.sa_flags = 0;
   
                       if (pthread_mutex_lock(&mutex_sigaction) != 0)
                       {
                           (*s_etat_processus).erreur_systeme = d_es_processus;
                           return;
                       }
   
                     if (sigaction(SIGPIPE, &action, &registre) != 0)                      if (sigaction(SIGPIPE, &action, &registre) != 0)
                     {                      {
                           pthread_mutex_unlock(&mutex_sigaction);
                         pthread_mutex_unlock(&((*s_etat_processus)                          pthread_mutex_unlock(&((*s_etat_processus)
                                 .mutex_pile_processus));                                  .mutex_pile_processus));
   
Line 785  instruction_poke(struct_processus *s_eta Line 792  instruction_poke(struct_processus *s_eta
   
                         if ((*s_etat_processus).erreur_systeme != d_es)                          if ((*s_etat_processus).erreur_systeme != d_es)
                         {                          {
                               pthread_mutex_unlock(&mutex_sigaction);
                             pthread_mutex_unlock(&((*s_etat_processus)                              pthread_mutex_unlock(&((*s_etat_processus)
                                     .mutex_pile_processus));                                      .mutex_pile_processus));
                             return;                              return;
                         }                          }
                     }                      }
   
                       /*
 #                   ifndef SEMAPHORES_NOMMES  #                   ifndef SEMAPHORES_NOMMES
                         if (sem_post(&((*s_etat_processus).semaphore_fork))                          if (sem_post(&((*s_etat_processus).semaphore_fork))
                                 != 0)                                  != 0)
Line 798  instruction_poke(struct_processus *s_eta Line 807  instruction_poke(struct_processus *s_eta
                         if (sem_post((*s_etat_processus).semaphore_fork) != 0)                          if (sem_post((*s_etat_processus).semaphore_fork) != 0)
 #                   endif  #                   endif
                     {                      {
                           pthread_mutex_unlock(&mutex_sigaction);
                         (*s_etat_processus).erreur_systeme = d_es_processus;                          (*s_etat_processus).erreur_systeme = d_es_processus;
                         return;                          return;
                     }                      }
                       */
   
                     while((longueur_ecriture = write_atomic(s_etat_processus,                      while((longueur_ecriture = write_atomic(s_etat_processus,
                             (*(*((struct_processus_fils *)                              (*(*((struct_processus_fils *)
Line 808  instruction_poke(struct_processus *s_eta Line 819  instruction_poke(struct_processus *s_eta
                             .pipe_nombre_injections[1], "-",                              .pipe_nombre_injections[1], "-",
                             sizeof(unsigned char))) != sizeof(unsigned char))                              sizeof(unsigned char))) != sizeof(unsigned char))
                     {                      {
                           /*
 #                       ifndef SEMAPHORES_NOMMES  #                       ifndef SEMAPHORES_NOMMES
                             while(sem_wait(                              while(sem_wait(
                                     &((*s_etat_processus).semaphore_fork)) != 0)                                      &((*s_etat_processus).semaphore_fork)) != 0)
Line 823  instruction_poke(struct_processus *s_eta Line 835  instruction_poke(struct_processus *s_eta
                                 return;                                  return;
                             }                              }
                         }                          }
                           */
   
                         if (longueur_ecriture == -1)                          if (longueur_ecriture == -1)
                         {                          {
                               pthread_mutex_unlock(&mutex_sigaction);
                             pthread_mutex_unlock(&((*s_etat_processus)                              pthread_mutex_unlock(&((*s_etat_processus)
                                     .mutex_pile_processus));                                      .mutex_pile_processus));
   
Line 854  instruction_poke(struct_processus *s_eta Line 868  instruction_poke(struct_processus *s_eta
   
                             if (sigaction(SIGPIPE, &registre, NULL) != 0)                              if (sigaction(SIGPIPE, &registre, NULL) != 0)
                             {                              {
                                   pthread_mutex_unlock(&mutex_sigaction);
                                 (*s_etat_processus).erreur_systeme =                                  (*s_etat_processus).erreur_systeme =
                                         d_es_signal;                                          d_es_signal;
                                 return;                                  return;
Line 862  instruction_poke(struct_processus *s_eta Line 877  instruction_poke(struct_processus *s_eta
                             return;                              return;
                         }                          }
   
                           /*
 #                       ifndef SEMAPHORES_NOMMES  #                       ifndef SEMAPHORES_NOMMES
                             if (sem_post(                              if (sem_post(
                                     &((*s_etat_processus).semaphore_fork)) != 0)                                      &((*s_etat_processus).semaphore_fork)) != 0)
Line 873  instruction_poke(struct_processus *s_eta Line 889  instruction_poke(struct_processus *s_eta
                             (*s_etat_processus).erreur_systeme = d_es_processus;                              (*s_etat_processus).erreur_systeme = d_es_processus;
                             return;                              return;
                         }                          }
                           */
                     }                      }
   
                     if (ecriture_pipe(s_etat_processus,                      if (ecriture_pipe(s_etat_processus,
Line 889  instruction_poke(struct_processus *s_eta Line 906  instruction_poke(struct_processus *s_eta
                         }                          }
                     }                      }
   
                       /*
 #                   ifndef SEMAPHORES_NOMMES  #                   ifndef SEMAPHORES_NOMMES
                         while(sem_wait(&((*s_etat_processus).semaphore_fork))                          while(sem_wait(&((*s_etat_processus).semaphore_fork))
                                 != 0)                                  != 0)
Line 902  instruction_poke(struct_processus *s_eta Line 920  instruction_poke(struct_processus *s_eta
                             return;                              return;
                         }                          }
                     }                      }
                       */
   
                     if (registre_stop == 0)                      if (registre_stop == 0)
                     {                      {
Line 923  instruction_poke(struct_processus *s_eta Line 942  instruction_poke(struct_processus *s_eta
   
                     if (sigaction(SIGPIPE, &registre, NULL) != 0)                      if (sigaction(SIGPIPE, &registre, NULL) != 0)
                     {                      {
                           pthread_mutex_unlock(&mutex_sigaction);
                         pthread_mutex_unlock(&((*s_etat_processus)                          pthread_mutex_unlock(&((*s_etat_processus)
                                 .mutex_pile_processus));                                  .mutex_pile_processus));
   
Line 930  instruction_poke(struct_processus *s_eta Line 950  instruction_poke(struct_processus *s_eta
                         return;                          return;
                     }                      }
   
                       if (pthread_mutex_unlock(&mutex_sigaction) != 0)
                       {
                           (*s_etat_processus).erreur_systeme = d_es_processus;
                           return;
                       }
   
                     break;                      break;
                 }                  }
             }              }
Line 956  instruction_poke(struct_processus *s_eta Line 982  instruction_poke(struct_processus *s_eta
                     // de lecteur et on peut se prendre un SIGPIPE dans la                      // de lecteur et on peut se prendre un SIGPIPE dans la
                     // figure !                      // figure !
   
                       if (pthread_mutex_lock(&mutex_sigaction) != 0)
                       {
                           (*s_etat_processus).erreur_systeme = d_es_processus;
                           return;
                       }
   
                     action.sa_handler = SIG_IGN;                      action.sa_handler = SIG_IGN;
                     action.sa_flags = 0;                      action.sa_flags = 0;
   
                     if (sigaction(SIGPIPE, &action, &registre) != 0)                      if (sigaction(SIGPIPE, &action, &registre) != 0)
                     {                      {
                           pthread_mutex_unlock(&mutex_sigaction);
                         pthread_mutex_unlock(&((*s_etat_processus)                          pthread_mutex_unlock(&((*s_etat_processus)
                                 .mutex_pile_processus));                                  .mutex_pile_processus));
   
Line 976  instruction_poke(struct_processus *s_eta Line 1009  instruction_poke(struct_processus *s_eta
                             (*(*l_element_courant).donnee).objet)).thread)                              (*(*l_element_courant).donnee).objet)).thread)
                             .mutex)) != 0)                              .mutex)) != 0)
                     {                      {
                           pthread_mutex_unlock(&mutex_sigaction);
                         (*s_etat_processus).erreur_systeme = d_es_processus;                          (*s_etat_processus).erreur_systeme = d_es_processus;
                         return;                          return;
                     }                      }
Line 996  instruction_poke(struct_processus *s_eta Line 1030  instruction_poke(struct_processus *s_eta
                                     (*(*l_element_courant).donnee).objet))                                      (*(*l_element_courant).donnee).objet))
                                     .thread).mutex)) != 0)                                      .thread).mutex)) != 0)
                             {                              {
                                   pthread_mutex_unlock(&mutex_sigaction);
                                 (*s_etat_processus).erreur_systeme =                                  (*s_etat_processus).erreur_systeme =
                                         d_es_processus;                                          d_es_processus;
                                 return;                                  return;
Line 1011  instruction_poke(struct_processus *s_eta Line 1046  instruction_poke(struct_processus *s_eta
                                 (*(*l_element_courant).donnee).objet))                                  (*(*l_element_courant).donnee).objet))
                                 .thread).mutex)) != 0)                                  .thread).mutex)) != 0)
                         {                          {
                               pthread_mutex_unlock(&mutex_sigaction);
                             (*s_etat_processus).erreur_systeme = d_es_processus;                              (*s_etat_processus).erreur_systeme = d_es_processus;
                             return;                              return;
                         }                          }
Line 1022  instruction_poke(struct_processus *s_eta Line 1058  instruction_poke(struct_processus *s_eta
                             (*(*l_element_courant).donnee).objet)).thread)                              (*(*l_element_courant).donnee).objet)).thread)
                             .mutex)) != 0)                              .mutex)) != 0)
                     {                      {
                           pthread_mutex_unlock(&mutex_sigaction);
                         (*s_etat_processus).erreur_systeme = d_es_processus;                          (*s_etat_processus).erreur_systeme = d_es_processus;
                         return;                          return;
                     }                      }
Line 1038  instruction_poke(struct_processus *s_eta Line 1075  instruction_poke(struct_processus *s_eta
   
                         if ((*s_etat_processus).erreur_systeme != d_es)                          if ((*s_etat_processus).erreur_systeme != d_es)
                         {                          {
                               pthread_mutex_unlock(&mutex_sigaction);
                             pthread_mutex_unlock(&((*s_etat_processus)                              pthread_mutex_unlock(&((*s_etat_processus)
                                     .mutex_pile_processus));                                      .mutex_pile_processus));
                             return;                              return;
                         }                          }
                     }                      }
   
                       /*
 #                   ifndef SEMAPHORES_NOMMES  #                   ifndef SEMAPHORES_NOMMES
                         if (sem_post(                          if (sem_post(
                                 &((*s_etat_processus).semaphore_fork)) != 0)                                  &((*s_etat_processus).semaphore_fork)) != 0)
Line 1055  instruction_poke(struct_processus *s_eta Line 1094  instruction_poke(struct_processus *s_eta
                         (*s_etat_processus).erreur_systeme = d_es_processus;                          (*s_etat_processus).erreur_systeme = d_es_processus;
                         return;                          return;
                     }                      }
                       */
   
                     while((longueur_ecriture = write_atomic(s_etat_processus,                      while((longueur_ecriture = write_atomic(s_etat_processus,
                             (*(*((struct_processus_fils *)                              (*(*((struct_processus_fils *)
Line 1062  instruction_poke(struct_processus *s_eta Line 1102  instruction_poke(struct_processus *s_eta
                             .pipe_nombre_injections[1], "-",                              .pipe_nombre_injections[1], "-",
                             sizeof(unsigned char))) != sizeof(unsigned char))                              sizeof(unsigned char))) != sizeof(unsigned char))
                     {                      {
                           /*
 #                       ifndef SEMAPHORES_NOMMES  #                       ifndef SEMAPHORES_NOMMES
                             while(sem_wait(                              while(sem_wait(
                                     &((*s_etat_processus).semaphore_fork)) != 0)                                      &((*s_etat_processus).semaphore_fork)) != 0)
Line 1077  instruction_poke(struct_processus *s_eta Line 1118  instruction_poke(struct_processus *s_eta
                                 return;                                  return;
                             }                              }
                         }                          }
                           */
   
                         if (longueur_ecriture == -1)                          if (longueur_ecriture == -1)
                         {                          {
Line 1108  instruction_poke(struct_processus *s_eta Line 1150  instruction_poke(struct_processus *s_eta
   
                             if (sigaction(SIGPIPE, &registre, NULL) != 0)                              if (sigaction(SIGPIPE, &registre, NULL) != 0)
                             {                              {
                                   pthread_mutex_unlock(&mutex_sigaction);
                                 (*s_etat_processus).erreur_systeme =                                  (*s_etat_processus).erreur_systeme =
                                         d_es_signal;                                          d_es_signal;
                                 return;                                  return;
                             }                              }
   
                               pthread_mutex_unlock(&mutex_sigaction);
                             return;                              return;
                         }                          }
   
                           /*
 #                       ifndef SEMAPHORES_NOMMES  #                       ifndef SEMAPHORES_NOMMES
                             if (sem_post(                              if (sem_post(
                                     &((*s_etat_processus).semaphore_fork)) != 0)                                      &((*s_etat_processus).semaphore_fork)) != 0)
Line 1127  instruction_poke(struct_processus *s_eta Line 1172  instruction_poke(struct_processus *s_eta
                             (*s_etat_processus).erreur_systeme = d_es_processus;                              (*s_etat_processus).erreur_systeme = d_es_processus;
                             return;                              return;
                         }                          }
                           */
                     }                      }
   
                     if (ecriture_pipe(s_etat_processus,                      if (ecriture_pipe(s_etat_processus,
Line 1143  instruction_poke(struct_processus *s_eta Line 1189  instruction_poke(struct_processus *s_eta
                         }                          }
                     }                      }
   
                       /*
 #                   ifndef SEMAPHORES_NOMMES  #                   ifndef SEMAPHORES_NOMMES
                         while(sem_wait(                          while(sem_wait(
                                 &((*s_etat_processus).semaphore_fork)) != 0)                                  &((*s_etat_processus).semaphore_fork)) != 0)
Line 1157  instruction_poke(struct_processus *s_eta Line 1204  instruction_poke(struct_processus *s_eta
                             return;                              return;
                         }                          }
                     }                      }
                       */
   
                     if (registre_stop == 0)                      if (registre_stop == 0)
                     {                      {
Line 1178  instruction_poke(struct_processus *s_eta Line 1226  instruction_poke(struct_processus *s_eta
   
                     if (sigaction(SIGPIPE, &registre, NULL) != 0)                      if (sigaction(SIGPIPE, &registre, NULL) != 0)
                     {                      {
                           pthread_mutex_unlock(&mutex_sigaction);
                         pthread_mutex_unlock(&((*s_etat_processus)                          pthread_mutex_unlock(&((*s_etat_processus)
                                 .mutex_pile_processus));                                  .mutex_pile_processus));
   
Line 1185  instruction_poke(struct_processus *s_eta Line 1234  instruction_poke(struct_processus *s_eta
                         return;                          return;
                     }                      }
   
                       if (pthread_mutex_unlock(&mutex_sigaction) != 0)
                       {
                           (*s_etat_processus).erreur_systeme = d_es_processus;
                           return;
                       }
   
                     break;                      break;
                 }                  }
             }              }

Removed from v.1.79  
changed lines
  Added in v.1.80


CVSweb interface <joel.bertrand@systella.fr>