Browse code

- split init_mallocs into init_pkg_mallocs & init_shm_mallocs - init_shm_mallocs called after cmd. line parsing (so -m is not ignored any more)

Andrei Pelinescu-Onciul authored on 08/04/2003 16:02:43
Showing 5 changed files
... ...
@@ -13,6 +13,7 @@
13 13
 #               by Maxim Sobolev   <sobomax@FreeBSD.org> and 
14 14
 #                  Tomas Bj´┐Żrklund <tomas@webservices.se>
15 15
 #  2003-03-11  PREFIX & LOCALBASE must also be exported (andrei)
16
+#  2003-04-07  hacked to work with solaris install (andrei)
16 17
 #
17 18
 
18 19
 auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
... ...
@@ -20,8 +21,10 @@ auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
20 21
 #include  source related defs
21 22
 include Makefile.sources
22 23
 
23
-override exclude_modules:=CVS cpl cpl-c ext radius_acc radius_auth snmp jabber sms pa extcmd msilo \
24
-	$(exclude_modules)
24
+override exclude_modules:=CVS cpl cpl-c ext radius_acc radius_auth snmp \
25
+							jabber sms pa extcmd msilo \
26
+							auth_radius group_radius uri_radius \
27
+							$(exclude_modules)
25 28
 static_modules=
26 29
 static_modules_path=$(addprefix modules/, $(static_modules))
27 30
 extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
... ...
@@ -21,7 +21,7 @@
21 21
 VERSION = 0
22 22
 PATCHLEVEL = 8
23 23
 SUBLEVEL =   11
24
-EXTRAVERSION = pre13
24
+EXTRAVERSION = pre14
25 25
 
26 26
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
27 27
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -32,6 +32,8 @@
32 32
  *  2003-03-29  pkg cleaners for fifo and script callbacks introduced (jiri)
33 33
  *  2003-03-31  removed snmp part (obsolete & no place in core) (andrei)
34 34
  *  2003-04-06  child_init called in all processes (janakj)
35
+ *  2003-04-08  init_mallocs split into init_{pkg,shm}_mallocs and 
36
+ *               init_shm_mallocs called after cmd. line parsing (andrei)
35 37
  *
36 38
  */
37 39
 
... ...
@@ -1088,8 +1090,8 @@ int main(int argc, char** argv)
1088 1090
 	ret=-1;
1089 1091
 	my_argc=argc; my_argv=argv;
1090 1092
 	
1091
-	/*init mallocs (before parsing cfg or cmd line !)*/
1092
-	if (init_mallocs()==-1)
1093
+	/*init pkg mallocs (before parsing cfg or cmd line !)*/
1094
+	if (init_pkg_mallocs()==-1)
1093 1095
 		goto error;
1094 1096
 
1095 1097
 	/* added by jku: add exit handler */
... ...
@@ -1308,6 +1310,13 @@ try_again:
1308 1310
 	
1309 1311
 
1310 1312
 
1313
+	/*init shm mallocs (before parsing cfg !)
1314
+	 *  this must be here to allow setting shm mem size from the command line
1315
+	 *  and it must also be before init_timer and init_tcp
1316
+	 *  => if shm_mem should be settable from the cfg file move everything
1317
+	 *  after --andrei */
1318
+	if (init_shm_mallocs()==-1)
1319
+		goto error;
1311 1320
 	/*init timer, before parsing the cfg!*/
1312 1321
 	if (init_timer()<0){
1313 1322
 		LOG(L_CRIT, "could not initialize timer, exiting...\n");
... ...
@@ -1335,14 +1344,14 @@ try_again:
1335 1344
 		fprintf(stderr, "ERROR: bad config file (%d errors)\n", cfg_errors);
1336 1345
 		goto error;
1337 1346
 	}
1338
-
1339
-
1340
-
1347
+	
1348
+	
1349
+	
1341 1350
 	print_rl();
1342
-
1351
+	
1343 1352
 	/* fix parameters */
1344 1353
 	if (port_no<=0) port_no=SIP_PORT;
1345
-
1354
+	
1346 1355
 	
1347 1356
 	if (children_no<=0) children_no=CHILD_NO;
1348 1357
 #ifdef USE_TCP
... ...
@@ -23,6 +23,12 @@
23 23
  * You should have received a copy of the GNU General Public License 
24 24
  * along with this program; if not, write to the Free Software 
25 25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
+ *
27
+ *
28
+ * History:
29
+ * --------
30
+ *  2003-04-08  init_mallocs split into init_{pkg,shm}_malloc (andrei)
31
+ * 
26 32
  */
27 33
 
28 34
 
... ...
@@ -55,7 +61,8 @@
55 61
 	#endif
56 62
 #endif
57 63
 
58
-int init_mallocs()
64
+
65
+int init_pkg_mallocs()
59 66
 {
60 67
 #ifdef PKG_MALLOC
61 68
 	/*init mem*/
... ...
@@ -73,7 +80,13 @@ int init_mallocs()
73 80
 		return -1;
74 81
 	}
75 82
 #endif
83
+	return 0;
84
+}
76 85
 
86
+
87
+
88
+int init_shm_mallocs()
89
+{
77 90
 #ifdef SHM_MEM
78 91
 	if (shm_mem_init()<0) {
79 92
 		LOG(L_CRIT, "could not initialize shared memory pool, exiting...\n");
... ...
@@ -83,7 +96,6 @@ int init_mallocs()
83 96
 	}
84 97
 #endif
85 98
 	return 0;
86
-
87 99
 }
88 100
 
89 101
 
... ...
@@ -31,6 +31,8 @@
31 31
  * --------
32 32
  *  2003-03-10  __FUNCTION__ is a gcc-ism, defined it to "" for sun cc
33 33
  *               (andrei)
34
+ *  2003-03-07  split init_malloc into init_pkg_mallocs & init_shm_mallocs 
35
+ *               (andrei)
34 36
  */
35 37
 
36 38
 
... ...
@@ -109,6 +111,7 @@
109 111
 #	define pkg_status()
110 112
 #endif
111 113
 
112
-int init_mallocs();
114
+int init_pkg_mallocs();
115
+int init_shm_mallocs();
113 116
 
114 117
 #endif