Ignore:
Timestamp:
Jun 12, 2015, 1:12:32 PM (9 years ago)
Author:
djay
Message:

Small fixes for building on GNU/Linux.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r652 r653  
    5757  FILE* f0 = fopen (fbkpid, "r");
    5858  if(f0!=NULL){
     59    long flen;
     60    char *fcontent;
    5961    fseek (f0, 0, SEEK_END);
    60     long flen = ftell (f0);
     62    flen = ftell (f0);
    6163    fseek (f0, 0, SEEK_SET);
    62     char *tmps1 = (char *) malloc ((flen + 1) * sizeof (char));
    63     fread(tmps1,flen,1,f0);
    64     tmps1[flen]=0;
     64    fcontent = (char *) malloc ((flen + 1) * sizeof (char));
     65    fread(fcontent,flen,1,f0);
     66    fcontent[flen]=0;
    6567    fclose(f0);
    66     return tmps1;
     68    return fcontent;
    6769  }else
    6870    return NULL;
     
    188190  FILE* f0 = fopen (fbkpid, "r");
    189191  if(f0!=NULL){
    190     char* stat=getStatusId(conf,lid);
     192    semid lockid;
     193    char* stat;
     194    long flen;
     195    stat=getStatusId(conf,lid);
    191196    if(stat!=NULL){
    192197      setMapInMaps(conf,"lenv","lid",stat);
    193       semid lockid=acquireLock(conf);
     198      lockid=acquireLock(conf);
    194199      if(lockid<0)
    195200        return NULL;
    196201    }
    197202    fseek (f0, 0, SEEK_END);
    198     long flen = ftell (f0);
     203    flen = ftell (f0);
    199204    if(flen>0){
     205      char *fcontent;
    200206      fseek (f0, 0, SEEK_SET);
    201       char *tmps1 = (char *) malloc ((flen + 1) * sizeof (char));
    202       fread(tmps1,flen,1,f0);
    203       tmps1[flen]=0;
     207      fcontent = (char *) malloc ((flen + 1) * sizeof (char));
     208      fread(fcontent,flen,1,f0);
     209      fcontent[flen]=0;
    204210      fclose(f0);
    205211      free(fbkpid);
     
    208214        free(stat);
    209215      }
    210       return tmps1;
     216      return fcontent;
    211217    }
    212218    fclose(f0);
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png