Browse code

- fixed process table alloc bug (size calc. before the modules had a chance to register timer functions)

Andrei Pelinescu-Onciul authored on 19/09/2002 11:23:03
Showing 1 changed files
... ...
@@ -1254,6 +1254,15 @@ int main(int argc, char** argv)
1254 1254
 				" the first one)":"");
1255 1255
 	}
1256 1256
 	
1257
+	/* init_daemon? */
1258
+	if (!dont_fork){
1259
+		if ( daemonize(argv[0]) <0 ) goto error;
1260
+	}
1261
+	if (init_modules() != 0) {
1262
+		fprintf(stderr, "ERROR: error while initializing modules\n");
1263
+		goto error;
1264
+	}
1265
+	
1257 1266
 	/*alloc pids*/
1258 1267
 #ifdef SHM_MEM
1259 1268
 	pt=shm_malloc(sizeof(struct process_table)*process_count());
... ...
@@ -1265,15 +1274,6 @@ int main(int argc, char** argv)
1265 1265
 		goto error;
1266 1266
 	}
1267 1267
 	memset(pt, 0, sizeof(struct process_table)*process_count());
1268
-	
1269
-	/* init_daemon? */
1270
-	if (!dont_fork){
1271
-		if ( daemonize(argv[0]) <0 ) goto error;
1272
-	}
1273
-	if (init_modules() != 0) {
1274
-		fprintf(stderr, "ERROR: error while initializing modules\n");
1275
-		goto error;
1276
-	}
1277 1268
 	/* fix routing lists */
1278 1269
 	if ( (r=fix_rls())!=0){
1279 1270
 		fprintf(stderr, "ERROR: error %x while trying to fix configuration\n",