- Timestamp:
- May 4, 2019, 5:54:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/server_internal.c
r909 r910 379 379 rewind(file); 380 380 if(getMap(content,"storage")==NULL){ 381 map* tmpMap1=getMap(content,"value"); 382 if(tmpMap1==NULL){ 383 addToMap(content,"value",""); 384 tmpMap1=getMap(content,"value"); 385 } 386 free(tmpMap1->value); 387 tmpMap1->value=(char*) malloc((count+1)*sizeof(char)); 388 if(tmpMap1->value==NULL){ 389 setMapInMaps(m,"lenv","message","Unable to allocate the memory required to read the produced file."); 390 } 391 fread(tmpMap1->value,1,count,file); 392 tmpMap1->value[count]=0; 381 map* memUse=getMapFromMaps(m,"main","memory"); 382 if(memUse==NULL || strncmp(memUse->value,"load",4)==0){ 383 map* tmpMap1=getMap(content,"value"); 384 if(tmpMap1==NULL){ 385 addToMap(content,"value",""); 386 tmpMap1=getMap(content,"value"); 387 } 388 free(tmpMap1->value); 389 tmpMap1->value=(char*) malloc((f_status.st_size+1)*sizeof(char)); 390 if(tmpMap1->value==NULL){ 391 setMapInMaps(m,"lenv","message","Unable to allocate the memory required to read the produced file."); 392 } 393 fread(&tmpMap1->value,1,f_status.st_size,file); 394 tmpMap1->value[f_status.st_size]=0; 395 } 393 396 } 394 397 fclose(file);
Note: See TracChangeset
for help on using the changeset viewer.