Diff for /rpl/src/instructions_s1.c between versions 1.107 and 1.108

version 1.107, 2019/05/16 12:03:01 version 1.108, 2019/06/17 13:27:35
Line 3454  instruction_syseval(struct_processus *s_ Line 3454  instruction_syseval(struct_processus *s_
 {  {
     char                        **arguments;      char                        **arguments;
   
       int                         etape;
     int                         ios;      int                         ios;
     int                         pipes_entree[2];      int                         pipes_entree[2];
     int                         pipes_erreur[2];      int                         pipes_erreur[2];
     int                         pipes_sortie[2];      int                         pipes_sortie[2];
     int                         status;      int                         status;
   
       file                        *fpipe;
   
     logical1                    drapeau_fin;      logical1                    drapeau_fin;
     logical1                    presence_stdin;      logical1                    presence_stdin;
   
Line 3486  instruction_syseval(struct_processus *s_ Line 3489  instruction_syseval(struct_processus *s_
   
     struct timespec             attente;      struct timespec             attente;
   
       struct timeval              horodatage_final;
       struct timeval              horodatage_initial;
   
     unsigned char               *ptr;      unsigned char               *ptr;
     unsigned char               *ptr2;      unsigned char               *ptr2;
     unsigned char               registre_autorisation_empilement_programme;      unsigned char               registre_autorisation_empilement_programme;
Line 4078  instruction_syseval(struct_processus *s_ Line 4084  instruction_syseval(struct_processus *s_
   
                 if ((*s_etat_processus).var_volatile_requete_arret == -1)                  if ((*s_etat_processus).var_volatile_requete_arret == -1)
                 {                  {
                       gettimeofday(&horodatage_initial, NULL);
   
                     if ((*s_etat_processus).var_volatile_alarme == -1)                      if ((*s_etat_processus).var_volatile_alarme == -1)
                     {                      {
                         kill(pid, SIGKILL);                          kill(pid, SIGKILL);
Line 4086  instruction_syseval(struct_processus *s_ Line 4094  instruction_syseval(struct_processus *s_
                     {                      {
                         kill(pid, SIGTERM);                          kill(pid, SIGTERM);
                     }                      }
   
                       if ((fpipe = fdopen(pipes_sortie[0], "r")) == NULL)
                       {
                           (*s_etat_processus).erreur_systeme =
                                   d_es_erreur_fichier;
                           return;
                       }
   
                       etape = 1;
   
                       while((ios = getc(fpipe)) != EOF)
                       {
                           if (etape == 1)
                           {
                               gettimeofday(&horodatage_final, NULL);
   
                               // Si au bout de 10 secondes après le premier
                               // signal, il reste des données à lire, le processus
                               // est sans doute encore actif. On envoie donc
                               // un signal 9.
   
                               if ((horodatage_final.tv_sec -
                                       horodatage_initial.tv_sec) > 10)
                               {
                                   etape = 2;
                                   kill(pid, SIGKILL);
                                   gettimeofday(&horodatage_initial, NULL);
                               }
                           }
                       }
   
                       fclose(fpipe);
                       break;
                 }                  }
             }              }
   

Removed from v.1.107  
changed lines
  Added in v.1.108


CVSweb interface <joel.bertrand@systella.fr>