Ignore:
Timestamp:
Jan 6, 2014, 11:09:29 AM (10 years ago)
Author:
djay
Message:

Small fixes for building on windows platform.

File:
1 edited

Legend:

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

    r411 r451  
    113113
    114114int zoo_python_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){
     115  char *pythonpath;
     116  char *python_path;
    115117  maps* m=*main_conf;
    116118  maps* inputs=*real_inputs;
     
    119121  char *ntmp=tmp0->value;
    120122  map* tmp=NULL;
     123  int hasToClean=0;
    121124  tmp=getMapFromMaps(*main_conf,"env","PYTHONPATH");
    122   char *python_path;
    123125#ifdef DEBUG
    124126  fprintf(stderr,"PYTHON SUPPORT \n");
    125127#endif
    126   fflush(stderr);
    127128  if(tmp!=NULL){
    128129#ifdef DEBUG
     
    131132    python_path=(char*)malloc((strlen(tmp->value))*sizeof(char));
    132133    sprintf(python_path,"%s",tmp->value);
     134    hasToClean=1;
    133135  }
    134136  else{
    135     python_path=strdup(".");
     137    python_path=".";
    136138  }
    137139  tmp=NULL;
    138140  tmp=getMap(request,"metapath");
    139   char *pythonpath;//=(char*)malloc((1+strlen(python_path)+2048)*sizeof(char));
    140141  if(tmp!=NULL && strcmp(tmp->value,"")!=0){
    141142    pythonpath=(char*)malloc((4+strlen(python_path)+strlen(ntmp)+strlen(tmp->value))*sizeof(char));
    142143#ifdef WIN32
    143     sprintf(pythonpath,"%s/%s/;%s",ntmp,tmp->value,python_path);
    144 #else
    145     sprintf(pythonpath,"%s/%s/:%s",ntmp,tmp->value,python_path);
     144  sprintf(pythonpath,"%s/%s/;%s",ntmp,tmp->value,python_path);
     145#else
     146  sprintf(pythonpath,"%s/%s/:%s",ntmp,tmp->value,python_path);
    146147#endif
    147148  }
     
    164165  sprintf(toto,"PYTHONPATH=%s",pythonpath);
    165166  putenv(toto);
    166 #endif
    167   free(python_path);
     167  free(toto);
     168#endif
     169  if(hasToClean>0)
     170    free(python_path);
    168171  free(pythonpath);
    169172
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