version 1.1, 2011/12/05 19:35:54
|
version 1.41, 2019/02/03 14:40:51
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.5 |
RPL/2 (R) version 4.1.31 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2019 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 38
|
Line 38
|
void |
void |
instruction_poll(struct_processus *s_etat_processus) |
instruction_poll(struct_processus *s_etat_processus) |
{ |
{ |
|
int erreur; |
|
int i; |
int ios; |
int ios; |
int timeout; |
int nombre_descripteurs; |
|
|
|
integer8 timeout; |
|
|
logical1 drapeau; |
logical1 drapeau; |
|
|
|
short masque; |
|
|
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
|
struct_liste_chainee *l_element_courant_2; |
|
|
struct_objet *s_objet_argument_1; |
struct_objet *s_objet_argument_1; |
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_argument_3; |
struct_objet *s_objet_liste; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
struct_objet **s_objet_tmp; |
|
|
struct pollfd s_poll; |
struct pollfd *s_poll; |
|
|
unsigned char *registre; |
unsigned char *registre; |
|
|
Line 60 instruction_poll(struct_processus *s_eta
|
Line 68 instruction_poll(struct_processus *s_eta
|
|
|
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
{ |
{ |
printf("(attente d'un événement sur un fichier ou une socket)\n\n"); |
printf("(attente d'un événement sur une liste de fichiers ou " |
|
"de sockets)\n\n"); |
} |
} |
else |
else |
{ |
{ |
printf("(wait for event on file or socket)\n\n"); |
printf("(wait for event on files or sockets list)\n\n"); |
} |
} |
|
|
|
printf(" 2: %s\n", d_LST); |
|
printf(" 1: %s, %s\n", d_INT, d_REL); |
|
printf("-> 1: %s\n\n", d_LST); |
|
|
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
{ |
{ |
printf(" Utilisation :\n\n"); |
printf(" Utilisation :\n\n"); |
Line 76 instruction_poll(struct_processus *s_eta
|
Line 89 instruction_poll(struct_processus *s_eta
|
printf(" Usage:\n\n"); |
printf(" Usage:\n\n"); |
} |
} |
|
|
printf(" FILE { \"POLLIN\" \"POLLOUT\" } TIMEOUT POLL\n"); |
printf(" { { FILE_1 \"POLLIN\" \"POLLOUT\" }\n" |
printf(" 3: %s, %s\n", d_SCK, d_FCH); |
" { FILE_2 \"POLLPRI\" } } TIMEOUT POLL\n"); |
printf(" 2: %s\n", d_LST); |
printf(" Input : POLLIN/POLLPRI/POLLOUT\n"); |
printf(" 1: %s, %s\n", d_INT, d_REL); |
printf(" Output : POLLIN/POLLPRI/POLLOUT/POLLERR/POLLHUP/POLLNVAL" |
printf("-> 1: %s\n", d_INT); |
"\n\n"); |
|
|
return; |
return; |
} |
} |
Line 92 instruction_poll(struct_processus *s_eta
|
Line 105 instruction_poll(struct_processus *s_eta
|
|
|
if (test_cfsf(s_etat_processus, 31) == d_vrai) |
if (test_cfsf(s_etat_processus, 31) == d_vrai) |
{ |
{ |
if (empilement_pile_last(s_etat_processus, 3) == d_erreur) |
if (empilement_pile_last(s_etat_processus, 2) == d_erreur) |
{ |
{ |
return; |
return; |
} |
} |
Line 108 instruction_poll(struct_processus *s_eta
|
Line 121 instruction_poll(struct_processus *s_eta
|
if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
&s_objet_argument_2) == d_erreur) |
&s_objet_argument_2) == d_erreur) |
{ |
{ |
liberation(s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
|
|
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
return; |
return; |
} |
} |
|
|
if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
if (((*s_objet_argument_2).type == LST) && (((*s_objet_argument_1).type == |
&s_objet_argument_3) == d_erreur) |
INT) || ((*s_objet_argument_1).type == REL))) |
{ |
{ |
liberation(s_objet_argument_1); |
l_element_courant = (*s_objet_argument_2).objet; |
liberation(s_objet_argument_2); |
nombre_descripteurs = 0; |
|
|
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
|
return; |
|
} |
|
|
|
if (((*s_objet_argument_3).type == SCK) || |
while(l_element_courant != NULL) |
((*s_objet_argument_3).type == FCH)) |
|
{ |
|
if ((*s_objet_argument_3).type == SCK) |
|
{ |
{ |
s_poll.fd = (*((struct_socket *) |
nombre_descripteurs++; |
(*s_objet_argument_1).objet)).socket; |
l_element_courant = (*l_element_courant).suivant; |
} |
} |
else |
|
|
if ((s_poll = malloc(((size_t) nombre_descripteurs) * |
|
sizeof(struct pollfd))) == NULL) |
{ |
{ |
s_poll.fd = (*((struct_fichier *) |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_objet_argument_1).objet)).descripteur; |
return; |
} |
} |
|
|
if ((*s_objet_argument_2).type != LST) |
if ((s_objet_tmp = malloc(((size_t) nombre_descripteurs) * |
|
sizeof(struct_objet *))) == NULL) |
{ |
{ |
liberation(s_etat_processus, s_objet_argument_1); |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_3); |
|
|
|
(*s_etat_processus).erreur_execution = d_ex_erreur_type_argument; |
|
return; |
return; |
} |
} |
|
|
l_element_courant = (*s_objet_argument_2).objet; |
l_element_courant = (*s_objet_argument_2).objet; |
s_poll.events = 0; |
i = 0; |
|
|
while(l_element_courant != NULL) |
while(l_element_courant != NULL) |
{ |
{ |
if ((*(*l_element_courant).donnee).type != CHN) |
if ((*(*l_element_courant).donnee).type != LST) |
{ |
{ |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_3); |
free(s_poll); |
|
free(s_objet_tmp); |
|
|
(*s_etat_processus).erreur_execution = |
(*s_etat_processus).erreur_execution = |
d_ex_erreur_type_argument; |
d_ex_erreur_type_argument; |
return; |
return; |
} |
} |
|
|
if ((registre = conversion_majuscule((unsigned char *) |
l_element_courant_2 = (*(*l_element_courant).donnee).objet; |
(*(*l_element_courant).donnee).objet)) == NULL) |
s_poll[i].events = 0; |
{ |
s_poll[i].revents = 0; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
drapeau = d_faux; |
return; |
|
} |
|
|
|
if (strcmp(registre, "POLLIN") == 0) |
while(l_element_courant_2 != NULL) |
{ |
{ |
s_poll.events |= POLLIN; |
switch((*(*l_element_courant_2).donnee).type) |
} |
{ |
else (strcmp(registre, "POLLOUT") == 0) |
case SCK: |
{ |
{ |
s_poll.events |= POLLOUT; |
if (drapeau == d_vrai) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
free(s_poll); |
|
free(s_objet_tmp); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_argument_invalide; |
|
return; |
|
} |
|
|
|
s_poll[i].fd = (*((struct_socket *) |
|
(*(*l_element_courant_2).donnee).objet)).socket; |
|
s_objet_tmp[i] = (*l_element_courant_2).donnee; |
|
drapeau = d_vrai; |
|
break; |
|
} |
|
|
|
case FCH: |
|
{ |
|
if (drapeau == d_vrai) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
free(s_poll); |
|
free(s_objet_tmp); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_argument_invalide; |
|
return; |
|
} |
|
|
|
s_poll[i].fd = (*((struct_fichier *) |
|
(*(*l_element_courant_2).donnee).objet)) |
|
.descripteur; |
|
s_objet_tmp[i] = (*l_element_courant_2).donnee; |
|
drapeau = d_vrai; |
|
break; |
|
} |
|
|
|
case CHN: |
|
{ |
|
if ((registre = conversion_majuscule(s_etat_processus, |
|
(unsigned char *) (*(*l_element_courant_2) |
|
.donnee).objet)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (strcmp(registre, "POLLIN") == 0) |
|
{ |
|
s_poll[i].events |= POLLIN; |
|
} |
|
else if (strcmp(registre, "POLLOUT") == 0) |
|
{ |
|
s_poll[i].events |= POLLOUT; |
|
} |
|
else if (strcmp(registre, "POLLERR") == 0) |
|
{ |
|
s_poll[i].events |= POLLERR; |
|
} |
|
else |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
free(registre); |
|
free(s_poll); |
|
free(s_objet_tmp); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_parametre_fichier; |
|
return; |
|
} |
|
|
|
free(registre); |
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
free(s_poll); |
|
free(s_objet_tmp); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
} |
|
|
|
l_element_courant_2 = (*l_element_courant_2).suivant; |
} |
} |
else |
|
{ |
|
free(registre); |
|
|
|
|
if (drapeau == d_faux) |
|
{ |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_3); |
free(s_poll); |
|
free(s_objet_tmp); |
|
|
(*s_etat_processus).erreur_execution = |
(*s_etat_processus).erreur_execution = |
d_ex_erreur_parametre_fichier; |
d_ex_erreur_type_argument; |
return; |
return; |
} |
} |
|
|
free(registre); |
|
l_element_courant = (*l_element_courant).suivant; |
l_element_courant = (*l_element_courant).suivant; |
|
i++; |
} |
} |
|
|
s_poll.revents = 0; |
|
|
|
if ((*s_objet_argument_1).type == INT) |
if ((*s_objet_argument_1).type == INT) |
{ |
{ |
timeout = (*((integer8 *) (*s_objet_argument_1).objet)) * 1000L; |
timeout = (*((integer8 *) (*s_objet_argument_1).objet)) * 1000L; |
} |
} |
else if ((*s_objet_argument_1).type == REL) |
else |
{ |
{ |
timeout = (int) ((*((real8 *) (*s_objet_argument_1).objet)) |
timeout = (int) ((*((real8 *) (*s_objet_argument_1).objet)) |
* 1000L); |
* 1000L); |
} |
} |
else |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_3); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
|
|
if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
do |
do |
{ |
{ |
Line 238 instruction_poll(struct_processus *s_eta
|
Line 318 instruction_poll(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((ios = poll(&s_poll, 1, timeout)) < 0) |
if ((ios = poll(s_poll, (nfds_t) nombre_descripteurs, |
|
(int) timeout)) < 0) |
{ |
{ |
erreur = errno; |
erreur = errno; |
|
|
Line 253 instruction_poll(struct_processus *s_eta
|
Line 334 instruction_poll(struct_processus *s_eta
|
{ |
{ |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_3); |
free(s_poll); |
liberation(s_etat_processus, s_objet_resultat); |
free(s_objet_tmp); |
|
|
(*s_etat_processus).erreur_execution = |
(*s_etat_processus).erreur_execution = |
d_ex_erreur_acces_fichier; |
d_ex_erreur_acces_fichier; |
Line 291 instruction_poll(struct_processus *s_eta
|
Line 372 instruction_poll(struct_processus *s_eta
|
} |
} |
} while(drapeau == d_faux); |
} while(drapeau == d_faux); |
|
|
|
if ((s_objet_resultat = allocation(s_etat_processus, LST)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
if (ios > 0) |
if (ios > 0) |
{ |
{ |
// Sortie sur un événement |
// Sortie sur un événement |
(*((integer8 *) (*s_objet_resultat).objet)) = -1; |
|
|
masque = POLLIN | POLLPRI | POLLOUT | POLLERR | POLLHUP | POLLNVAL; |
|
|
|
for(i = nombre_descripteurs - 1; i >= 0; i--) |
|
{ |
|
if ((s_poll[i].revents & masque) != 0) |
|
{ |
|
if ((s_objet_liste = allocation(s_etat_processus, LST)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if ((s_poll[i].revents & POLLNVAL) != 0) |
|
{ |
|
l_element_courant = (*s_objet_liste).objet; |
|
|
|
if (((*s_objet_liste).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee = allocation(s_etat_processus, |
|
CHN)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee).objet = malloc(9 * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*((struct_liste_chainee *) |
|
(*s_objet_liste).objet)).donnee).objet, |
|
"POLLNVAL"); |
|
(*((struct_liste_chainee *) (*s_objet_liste).objet)) |
|
.suivant = l_element_courant; |
|
} |
|
else if ((s_poll[i].revents & POLLHUP) != 0) |
|
{ |
|
l_element_courant = (*s_objet_liste).objet; |
|
|
|
if (((*s_objet_liste).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee = allocation(s_etat_processus, |
|
CHN)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee).objet = malloc(8 * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*((struct_liste_chainee *) |
|
(*s_objet_liste).objet)).donnee).objet, |
|
"POLLHUP"); |
|
(*((struct_liste_chainee *) (*s_objet_liste).objet)) |
|
.suivant = l_element_courant; |
|
} |
|
else if ((s_poll[i].revents & POLLERR) != 0) |
|
{ |
|
l_element_courant = (*s_objet_liste).objet; |
|
|
|
if (((*s_objet_liste).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee = allocation(s_etat_processus, |
|
CHN)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee).objet = malloc(8 * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*((struct_liste_chainee *) |
|
(*s_objet_liste).objet)).donnee).objet, |
|
"POLLERR"); |
|
(*((struct_liste_chainee *) (*s_objet_liste).objet)) |
|
.suivant = l_element_courant; |
|
} |
|
else if ((s_poll[i].revents & POLLOUT) != 0) |
|
{ |
|
l_element_courant = (*s_objet_liste).objet; |
|
|
|
if (((*s_objet_liste).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee = allocation(s_etat_processus, |
|
CHN)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee).objet = malloc(8 * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*((struct_liste_chainee *) |
|
(*s_objet_liste).objet)).donnee).objet, |
|
"POLLOUT"); |
|
(*((struct_liste_chainee *) (*s_objet_liste).objet)) |
|
.suivant = l_element_courant; |
|
} |
|
else if ((s_poll[i].revents & POLLPRI) != 0) |
|
{ |
|
l_element_courant = (*s_objet_liste).objet; |
|
|
|
if (((*s_objet_liste).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee = allocation(s_etat_processus, |
|
CHN)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee).objet = malloc(8 * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*((struct_liste_chainee *) |
|
(*s_objet_liste).objet)).donnee).objet, |
|
"POLLPRI"); |
|
(*((struct_liste_chainee *) (*s_objet_liste).objet)) |
|
.suivant = l_element_courant; |
|
} |
|
else if ((s_poll[i].revents & POLLIN) != 0) |
|
{ |
|
l_element_courant = (*s_objet_liste).objet; |
|
|
|
if (((*s_objet_liste).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee = allocation(s_etat_processus, |
|
CHN)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee).objet = malloc(7 * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*((struct_liste_chainee *) |
|
(*s_objet_liste).objet)).donnee).objet, |
|
"POLLIN"); |
|
(*((struct_liste_chainee *) (*s_objet_liste).objet)) |
|
.suivant = l_element_courant; |
|
} |
|
|
|
l_element_courant = (*s_objet_liste).objet; |
|
|
|
if (((*s_objet_liste).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*((struct_liste_chainee *) (*s_objet_liste) |
|
.objet)).donnee = copie_objet(s_etat_processus, |
|
s_objet_tmp[i], 'P')) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
(*((struct_liste_chainee *) (*s_objet_liste).objet)) |
|
.suivant = l_element_courant; |
|
|
|
// Ajout de la liste fille au résultat. |
|
|
|
l_element_courant = (*s_objet_resultat).objet; |
|
|
|
if (((*s_objet_resultat).objet = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
(*((struct_liste_chainee *) (*s_objet_resultat).objet)) |
|
.donnee = s_objet_liste; |
|
(*((struct_liste_chainee *) (*s_objet_resultat).objet)) |
|
.suivant = l_element_courant; |
|
} |
|
} |
} |
} |
else |
else |
{ |
{ |
// Sortie sur timeout |
// Sortie sur timeout : on renvoit une liste vide. |
(*((integer8 *) (*s_objet_resultat).objet)) = 0; |
(*s_objet_resultat).objet = NULL; |
} |
} |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_3); |
free(s_poll); |
|
free(s_objet_tmp); |
|
|
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
s_objet_resultat) == d_erreur) |
s_objet_resultat) == d_erreur) |
Line 316 instruction_poll(struct_processus *s_eta
|
Line 675 instruction_poll(struct_processus *s_eta
|
{ |
{ |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_3); |
|
|
|
(*s_etat_processus).erreur_execution = d_ex_erreur_type_argument; |
(*s_etat_processus).erreur_execution = d_ex_erreur_type_argument; |
return; |
return; |