--- rpl/src/instructions_o1.c 2010/03/06 18:29:07 1.6 +++ rpl/src/instructions_o1.c 2010/05/19 09:22:34 1.13 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.12 + RPL/2 (R) version 4.0.15 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -1017,6 +1017,7 @@ instruction_open(struct_processus *s_eta "\"file name\" } \"protection\" } OPEN\n"); printf(" { \"sockettype\" { \"name\" \"local name\" } } OPEN\n"); printf(" { \"sockettype\" \"socketdomain\" \"protection\" } OPEN\n"); + printf(" \"/semaphore\" OPEN\n"); printf(" File type : NEW/OLD/REPLACE/UNKNOWN/SCRATCH\n"); printf(" File access : SEQUENTIAL/DIRECT/KEYED\n"); @@ -2649,7 +2650,9 @@ instruction_open(struct_processus *s_eta } if (((type_acces != 'I') && (position_clef != 0)) || - ((type_acces == 'I') && (position_clef == 0))) + ((type_acces == 'I') && (position_clef == 0) && + ((type_ouverture == 'N') || (type_ouverture == 'R') || + (type_ouverture == 'S')))) { liberation(s_etat_processus, s_objet_argument); @@ -2820,8 +2823,20 @@ instruction_open(struct_processus *s_eta } else { + if (position_clef == 0) + { + free(nom); + + liberation(s_etat_processus, s_objet_argument); + liberation(s_etat_processus, s_objet_resultat); + + (*s_etat_processus).erreur_execution = + d_ex_erreur_parametre_fichier; + return; + } + if (initialisation_fichier_acces_indexe( - s_etat_processus, sqlite, + s_etat_processus, sqlite, position_clef, (format == 'N') ? d_faux : d_vrai) != d_absence_erreur) { @@ -3056,8 +3071,20 @@ instruction_open(struct_processus *s_eta } else { + if (position_clef == 0) + { + free(nom); + + liberation(s_etat_processus, s_objet_argument); + liberation(s_etat_processus, s_objet_resultat); + + (*s_etat_processus).erreur_execution = + d_ex_erreur_parametre_fichier; + return; + } + if (initialisation_fichier_acces_indexe( - s_etat_processus, sqlite, + s_etat_processus, sqlite, position_clef, (format == 'N') ? d_faux : d_vrai) != d_absence_erreur) { @@ -3154,8 +3181,22 @@ instruction_open(struct_processus *s_eta } else { + if (position_clef == 0) + { + free(nom); + + liberation(s_etat_processus, + s_objet_argument); + liberation(s_etat_processus, + s_objet_resultat); + + (*s_etat_processus).erreur_execution = + d_ex_erreur_parametre_fichier; + return; + } + if (initialisation_fichier_acces_indexe( - s_etat_processus, sqlite, + s_etat_processus, sqlite, position_clef, (format == 'N') ? d_faux : d_vrai) != d_absence_erreur) { @@ -3309,9 +3350,21 @@ instruction_open(struct_processus *s_eta } } else - { + { + if (position_clef == 0) + { + free(nom); + + liberation(s_etat_processus, s_objet_argument); + liberation(s_etat_processus, s_objet_resultat); + + (*s_etat_processus).erreur_execution = + d_ex_erreur_parametre_fichier; + return; + } + if (initialisation_fichier_acces_indexe( - s_etat_processus, sqlite, + s_etat_processus, sqlite, position_clef, (format == 'N') ? d_faux : d_vrai) != d_absence_erreur) { @@ -4029,6 +4082,10 @@ instruction_open(struct_processus *s_eta strcpy((*((struct_socket *) (*s_objet_resultat).objet)). type, "ROBUST DATAGRAM"); break; + + default : + BUG(1, printf("type_socket=%c\n", type_socket)); + break; } if ((protection != 'N') && ((type_socket != 'S') && @@ -5208,6 +5265,8 @@ instruction_open(struct_processus *s_eta (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; } + + liberation(s_etat_processus, s_objet_argument); } else {