--- rpl/src/instructions_u1.c 2010/01/26 15:22:45 1.1 +++ rpl/src/instructions_u1.c 2011/06/27 09:05:00 1.27 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.0.9 - Copyright (C) 1989-2010 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.0 + 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" /* @@ -782,17 +782,35 @@ instruction_use(struct_processus *s_etat { free(tampon); - if ((tampon = malloc((strlen((unsigned char *) - (*s_objet_argument).objet) + strlen(d_exec_path) + 7) - * sizeof(unsigned char))) == NULL) + if ((*s_etat_processus).rpl_home == NULL) { - (*s_etat_processus).erreur_systeme = - d_es_allocation_memoire; - return; + if ((tampon = malloc((strlen((unsigned char *) + (*s_objet_argument).objet) + strlen(d_exec_path) + + 7) * sizeof(unsigned char))) == NULL) + { + (*s_etat_processus).erreur_systeme = + d_es_allocation_memoire; + return; + } + + sprintf(tampon, "/%s/lib/%s", d_exec_path, (unsigned char *) + (*s_objet_argument).objet); } + else + { + if ((tampon = malloc((strlen((unsigned char *) + (*s_objet_argument).objet) + + strlen((*s_etat_processus).rpl_home) + + 7) * sizeof(unsigned char))) == NULL) + { + (*s_etat_processus).erreur_systeme = + d_es_allocation_memoire; + return; + } - sprintf(tampon, "/%s/lib/%s", d_exec_path, (unsigned char *) - (*s_objet_argument).objet); + sprintf(tampon, "/%s/lib/%s", (*s_etat_processus).rpl_home, + (unsigned char *) (*s_objet_argument).objet); + } caracteristiques_fichier(s_etat_processus, tampon, &existence, &ouverture, &unite); @@ -1059,10 +1077,10 @@ instruction_uchol(struct_processus *s_et void instruction_unlock(struct_processus *s_etat_processus) { - file *descripteur; - struct flock lock; + struct_descripteur_fichier *descripteur; + struct_objet *s_objet; (*s_etat_processus).erreur_execution = d_ex; @@ -1119,7 +1137,8 @@ instruction_unlock(struct_processus *s_e return; } - if (fcntl(fileno(descripteur), F_SETLK, &lock) == -1) + if (fcntl(fileno((*descripteur).descripteur_c), F_SETLK, &lock) + == -1) { liberation(s_etat_processus, s_objet); @@ -1210,8 +1229,8 @@ instruction_unprotect(struct_processus * return; } - ((*s_etat_processus).s_liste_variables[(*s_etat_processus) - .position_variable_courante]).variable_verrouillee = d_faux; + (*(*s_etat_processus).pointeur_variable_courante) + .variable_verrouillee = d_faux; } else if ((*s_objet).type == LST) { @@ -1238,8 +1257,8 @@ instruction_unprotect(struct_processus * return; } - ((*s_etat_processus).s_liste_variables[(*s_etat_processus) - .position_variable_courante]).variable_verrouillee = d_faux; + (*(*s_etat_processus).pointeur_variable_courante) + .variable_verrouillee = d_faux; l_element_courant = (*l_element_courant).suivant; }