Changeset 765 for trunk/zoo-project/zoo-kernel
- Timestamp:
- May 30, 2016, 7:12:12 PM (8 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal_java.c
r748 r765 85 85 fprintf(stderr,"(%s)\n",oclasspath); 86 86 #endif 87 87 #ifndef WIN32 88 88 int nb=1; 89 #endif 89 90 int nbc0=0; 90 91 maps* javaXXMap=getMaps(*main_conf,"javaxx"); … … 98 99 } 99 100 #ifdef WIN32 100 nb=2+nbc0+nbc1; 101 JavaVMOption options[nb]; 101 //#define nb (2+nbc0+nbc1) 102 const int nb=2+nbc0+nbc1; 103 JavaVMOption *options=(JavaVMOption*)malloc(nb*sizeof(JavaVMOption)); 102 104 #else 103 105 JavaVMOption options[nb+nbc0+nbc1+1]; … … 259 261 free(options[start+i].optionString); 260 262 } 263 #ifdef WIN32 264 free(options); 265 #endif 261 266 return res; 262 267 } -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r752 r765 161 161 str[i] = toReplaceBy; 162 162 } 163 } 164 165 /** 166 * Dump back the final file fbkp1 to fbkp 167 * 168 * @param m the conf maps containing the main.cfg settings 169 * @param fbkp the string corresponding to the name of the file 170 * @param fbkp1 the string corresponding to the name of the file 171 */ 172 int dumpBackFinalFile(maps* m,char* fbkp,char* fbkp1) 173 { 174 FILE *f2 = fopen (fbkp1, "rb"); 175 #ifndef RELY_ON_DB 176 semid lid = getShmLockId (m, 1); 177 if (lid < 0) 178 return -1; 179 lockShm (lid); 180 #endif 181 FILE *f3 = fopen (fbkp, "wb+"); 182 free (fbkp); 183 fseek (f2, 0, SEEK_END); 184 long flen = ftell (f2); 185 fseek (f2, 0, SEEK_SET); 186 char *tmps1 = (char *) malloc ((flen + 1) * sizeof (char)); 187 fread (tmps1, flen, 1, f2); 188 #ifdef WIN32 189 char *pchr=strrchr(tmps1,'>'); 190 flen=strlen(tmps1)-strlen(pchr)+1; 191 tmps1[flen]=0; 192 #endif 193 fwrite (tmps1, 1, flen, f3); 194 fclose (f2); 195 fclose (f3); 196 return 1; 163 197 } 164 198 … … 2137 2171 freeService (&s1); 2138 2172 free (s1); 2173 fclose (f0); 2174 fclose (f1); 2175 if(dumpBackFinalFile(m,fbkp,fbkp1)<0) 2176 return -1; 2177 unlink (fbkpid); 2178 unhandleStatus (m); 2139 2179 freeMaps (&m); 2140 2180 free (m); … … 2149 2189 fflush (stdout); 2150 2190 fflush (stderr); 2151 unhandleStatus (m);2152 2191 return -1; 2153 2192 } … … 2190 2229 signal (SIGABRT, donothing); 2191 2230 #endif 2231 2192 2232 if (((int) getpid ()) != cpid || cgiSid != NULL) 2193 2233 { 2194 2234 fclose (stdout); 2195 2235 fclose (stderr); 2196 /** 2197 * Dump back the final file fbkp1 to fbkp 2198 */ 2236 2199 2237 fclose (f0); 2200 2238 fclose (f1); 2201 2239 2202 FILE *f2 = fopen (fbkp1, "rb"); 2203 #ifndef RELY_ON_DB 2204 semid lid = getShmLockId (m, 1); 2205 if (lid < 0) 2206 return -1; 2207 lockShm (lid); 2208 #endif 2209 FILE *f3 = fopen (fbkp, "wb+"); 2210 free (fbkp); 2211 fseek (f2, 0, SEEK_END); 2212 long flen = ftell (f2); 2213 fseek (f2, 0, SEEK_SET); 2214 char *tmps1 = (char *) malloc ((flen + 1) * sizeof (char)); 2215 fread (tmps1, flen, 1, f2); 2216 #ifdef WIN32 2217 char *pchr=strrchr(tmps1,'>'); 2218 flen=strlen(tmps1)-strlen(pchr)+1; 2219 tmps1[flen]=0; 2220 #endif 2221 fwrite (tmps1, 1, flen, f3); 2222 fclose (f2); 2223 fclose (f3); 2240 if(dumpBackFinalFile(m,fbkp,fbkp1)<0) 2241 return -1; 2242 2224 2243 unlink (fbkpid); 2225 2244 switch(eres){
Note: See TracChangeset
for help on using the changeset viewer.