--- rpl/src/instructions_w1.c 2010/07/14 14:19:39 1.19 +++ rpl/src/instructions_w1.c 2011/03/06 16:44:14 1.32 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.0.18 - Copyright (C) 1989-2010 Dr. BERTRAND Joël + RPL/2 (R) version 4.0.21 + Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -20,7 +20,7 @@ */ -#include "rpl.conv.h" +#include "rpl-conv.h" /* @@ -124,7 +124,7 @@ instruction_while(struct_processus *s_et void instruction_warranty(struct_processus *s_etat_processus) { -# include "garanties.conv.h" +# include "garanties-conv.h" (*s_etat_processus).erreur_execution = d_ex; @@ -226,8 +226,7 @@ instruction_wait(struct_processus *s_eta return; } - if (((*s_objet).type == INT) || - ((*s_objet).type == REL)) + if (((*s_objet).type == INT) || ((*s_objet).type == REL)) { if ((*s_objet).type == INT) { @@ -420,7 +419,9 @@ instruction_write(struct_processus *s_et struct sigaction registre; struct sockaddr_in adresse_ipv4; +# ifdef IPV6 struct sockaddr_in6 adresse_ipv6; +# endif struct sockaddr_un adresse_unix; struct flock lock; @@ -1416,7 +1417,7 @@ instruction_write(struct_processus *s_et } } - if (ios == EPIPE) + if ((ios == EPIPE) || (ios == ECONNRESET)) { (*s_etat_processus).erreur_execution = d_ex_erreur_acces_fichier; @@ -1480,8 +1481,9 @@ instruction_write(struct_processus *s_et adresse_unix.sun_family = AF_UNIX; strncpy(adresse_unix.sun_path, (*((struct_socket *) (*s_objet_argument_1).objet)).adresse_distante, - 108); - adresse_unix.sun_path[108 - 1] = d_code_fin_chaine; + UNIX_PATH_MAX); + adresse_unix.sun_path[UNIX_PATH_MAX - 1] = + d_code_fin_chaine; # ifndef SEMAPHORES_NOMMES if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) @@ -1634,6 +1636,7 @@ instruction_write(struct_processus *s_et &(adresse[12]), &(adresse[13]), &(adresse[14]), &(adresse[15]), &port)== 17) { // Adresse IPv6 +# ifdef IPV6 memset(&adresse_ipv6, 0, sizeof(adresse_ipv6)); adresse_ipv6.sin6_family = AF_INET6; adresse_ipv6.sin6_port = htons((uint16_t) port); @@ -1698,6 +1701,18 @@ instruction_write(struct_processus *s_et return; } } +# else + if ((*s_etat_processus).langue == 'F') + { + printf("+++Attention : Support du protocole" + " IPv6 indisponible\n"); + } + else + { + printf("+++Warning : IPv6 support " + "unavailable\n"); + } +# endif } else { @@ -2623,7 +2638,9 @@ instruction_wfsock(struct_processus *s_e struct_objet *s_objet_resultat; struct sockaddr_in adresse_ipv4; +# ifdef IPV6 struct sockaddr_in6 adresse_ipv6; +# endif unsigned long i; @@ -2789,6 +2806,7 @@ instruction_wfsock(struct_processus *s_e else if ((*((struct_socket *) (*s_objet_resultat).objet)).domaine == PF_INET6) { +# ifdef IPV6 longueur = sizeof(adresse_ipv6); do @@ -2892,6 +2910,18 @@ instruction_wfsock(struct_processus *s_e .objet)).adresse_distante, "%s(%u)", (*((struct_socket *) (*s_objet_resultat) .objet)).adresse_distante, ntohs(adresse_ipv6.sin6_port)); +# else + if ((*s_etat_processus).langue == 'F') + { + printf("+++Attention : Support du protocole" + " IPv6 indisponible\n"); + } + else + { + printf("+++Warning : IPv6 support " + "unavailable\n"); + } +# endif } else {