Browse code

- DBG replaced with LOG in some places of mod_init and init_child

Daniel-Constantin Mierla authored on 23/06/2003 15:04:56
Showing 1 changed files
... ...
@@ -194,20 +194,20 @@ static int mod_init(void)
194 194
 	DBG("XJAB:mod_init: initializing ...\n");
195 195
 	if(!jdomain)
196 196
 	{
197
-		DBG("XJAB:mod_init: ERROR jdomain is NULL\n");
197
+		LOG(L_ERR, "XJAB:mod_init: ERROR jdomain is NULL\n");
198 198
 		return -1;
199 199
 	}
200 200
 
201 201
 	/* import mysql functions */
202 202
 	if (bind_dbmod())
203 203
 	{
204
-		DBG("XJAB:mod_init: error - database module not found\n");
204
+		LOG(L_ERR, "XJAB:mod_init: error - database module not found\n");
205 205
 		return -1;
206 206
 	}
207 207
 	db_con = (db_con_t**)shm_malloc(nrw*sizeof(db_con_t*));
208 208
 	if (db_con == NULL)
209 209
 	{
210
-		DBG("XJAB:mod_init: Error while allocating db_con's\n");
210
+		LOG(L_ERR, "XJAB:mod_init: Error while allocating db_con's\n");
211 211
 		return -1;
212 212
 	}
213 213
 
... ...
@@ -234,7 +234,7 @@ static int mod_init(void)
234 234
 	pipes = (int**)pkg_malloc(nrw*sizeof(int*));
235 235
 	if (pipes == NULL)
236 236
 	{
237
-		DBG("XJAB:mod_init:Error while allocating pipes\n");
237
+		LOG(L_ERR, "XJAB:mod_init:Error while allocating pipes\n");
238 238
 		return -1;
239 239
 	}
240 240
 	
... ...
@@ -243,7 +243,7 @@ static int mod_init(void)
243 243
 		pipes[i] = (int*)pkg_malloc(2*sizeof(int));
244 244
 		if (!pipes[i])
245 245
 		{
246
-			DBG("XJAB:mod_init: Error while allocating pipes\n");
246
+			LOG(L_ERR, "XJAB:mod_init: Error while allocating pipes\n");
247 247
 			return -1;
248 248
 		}
249 249
 	}
... ...
@@ -253,7 +253,7 @@ static int mod_init(void)
253 253
 		db_con[i] = db_init(db_url);
254 254
 		if (!db_con[i])
255 255
 		{
256
-			DBG("XJAB:mod_init: Error while connecting database\n");
256
+			LOG(L_ERR, "XJAB:mod_init: Error while connecting database\n");
257 257
 			return -1;
258 258
 		}
259 259
 		else
... ...
@@ -270,7 +270,7 @@ static int mod_init(void)
270 270
 	{
271 271
 		/* create the pipe*/
272 272
 		if (pipe(pipes[i])==-1) {
273
-			DBG("XJAB:mod_init: error - cannot create pipe!\n");
273
+			LOG(L_ERR, "XJAB:mod_init: error - cannot create pipe!\n");
274 274
 			return -1;
275 275
 		}
276 276
 		DBG("XJAB:mod_init: pipe[%d] = <%d>-<%d>\n", i, pipes[i][0],
... ...
@@ -280,13 +280,13 @@ static int mod_init(void)
280 280
 	if((jwl = xj_wlist_init(pipes,nrw,max_jobs,cache_time,sleep_time,
281 281
 				delay_time)) == NULL)
282 282
 	{
283
-		DBG("XJAB:mod_init: error initializing workers list\n");
283
+		LOG(L_ERR, "XJAB:mod_init: error initializing workers list\n");
284 284
 		return -1;
285 285
 	}
286 286
 	
287 287
 	if(xj_wlist_set_aliases(jwl, jaliases, jdomain, proxy) < 0)
288 288
 	{
289
-		DBG("XJAB:mod_init: error setting aliases and outbound proxy\n");
289
+		LOG(L_ERR, "XJAB:mod_init: error setting aliases and outbound proxy\n");
290 290
 		return -1;
291 291
 	}
292 292
 
... ...
@@ -314,8 +314,9 @@ static int child_init(int rank)
314 314
 #endif
315 315
 		if((mpid=fork())<0 )
316 316
 		{
317
-			DBG("XJAB:child_init: error - cannot launch worker's manager\n");
318
-				return -1;
317
+			LOG(L_ERR, "XJAB:child_init:error - cannot launch worker's"
318
+					" manager\n");
319
+			return -1;
319 320
 		}
320 321
 		if(mpid == 0)
321 322
 		{
... ...
@@ -324,7 +325,7 @@ static int child_init(int rank)
324 325
 			{
325 326
 				if ( (cpid=fork())<0 )
326 327
 				{
327
-					DBG("XJAB:child_init: error - cannot launch worker\n");
328
+					LOG(L_ERR,"XJAB:child_init:error - cannot launch worker\n");
328 329
 					return -1;
329 330
 				}
330 331
 				if (cpid == 0)
... ...
@@ -334,7 +335,8 @@ static int child_init(int rank)
334 335
 					close(pipes[i][1]);
335 336
 					if(xj_wlist_set_pid(jwl, getpid(), i) < 0)
336 337
 					{
337
-						DBG("XJAB:child_init: error setting worker's pid\n");
338
+						LOG(L_ERR, "XJAB:child_init:error setting worker's"
339
+										" pid\n");
338 340
 						return -1;
339 341
 					}
340 342
 					xj_worker_process(jwl,jaddress,jport,i,db_con[i]);