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 20
 #include  source related defs
21 21
 include Makefile.sources
22 22
 
23
-override exclude_modules:=CVS cpl cpl-c ext radius_acc radius_auth snmp jabber sms pa extcmd msilo \
24
-	$(exclude_modules)
23
+override exclude_modules:=CVS cpl cpl-c ext radius_acc radius_auth snmp \
24
+							jabber sms pa extcmd msilo \
25
+							auth_radius group_radius uri_radius \
26
+							$(exclude_modules)
25 27
 static_modules=
26 28
 static_modules_path=$(addprefix modules/, $(static_modules))
27 29
 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 1088
 	ret=-1;
1089 1089
 	my_argc=argc; my_argv=argv;
1090 1090
 	
1091
-	/*init mallocs (before parsing cfg or cmd line !)*/
1092
-	if (init_mallocs()==-1)
1091
+	/*init pkg mallocs (before parsing cfg or cmd line !)*/
1092
+	if (init_pkg_mallocs()==-1)
1093 1093
 		goto error;
1094 1094
 
1095 1095
 	/* added by jku: add exit handler */
... ...
@@ -1308,6 +1310,13 @@ try_again:
1308 1308
 	
1309 1309
 
1310 1310
 
1311
+	/*init shm mallocs (before parsing cfg !)
1312
+	 *  this must be here to allow setting shm mem size from the command line
1313
+	 *  and it must also be before init_timer and init_tcp
1314
+	 *  => if shm_mem should be settable from the cfg file move everything
1315
+	 *  after --andrei */
1316
+	if (init_shm_mallocs()==-1)
1317
+		goto error;
1311 1318
 	/*init timer, before parsing the cfg!*/
1312 1319
 	if (init_timer()<0){
1313 1320
 		LOG(L_CRIT, "could not initialize timer, exiting...\n");
... ...
@@ -1335,14 +1344,14 @@ try_again:
1335 1335
 		fprintf(stderr, "ERROR: bad config file (%d errors)\n", cfg_errors);
1336 1336
 		goto error;
1337 1337
 	}
1338
-
1339
-
1340
-
1338
+	
1339
+	
1340
+	
1341 1341
 	print_rl();
1342
-
1342
+	
1343 1343
 	/* fix parameters */
1344 1344
 	if (port_no<=0) port_no=SIP_PORT;
1345
-
1345
+	
1346 1346
 	
1347 1347
 	if (children_no<=0) children_no=CHILD_NO;
1348 1348
 #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 55
 	#endif
56 56
 #endif
57 57
 
58
-int init_mallocs()
58
+
59
+int init_pkg_mallocs()
59 60
 {
60 61
 #ifdef PKG_MALLOC
61 62
 	/*init mem*/
... ...
@@ -73,7 +80,13 @@ int init_mallocs()
73 73
 		return -1;
74 74
 	}
75 75
 #endif
76
+	return 0;
77
+}
76 78
 
79
+
80
+
81
+int init_shm_mallocs()
82
+{
77 83
 #ifdef SHM_MEM
78 84
 	if (shm_mem_init()<0) {
79 85
 		LOG(L_CRIT, "could not initialize shared memory pool, exiting...\n");
... ...
@@ -83,7 +96,6 @@ int init_mallocs()
83 83
 	}
84 84
 #endif
85 85
 	return 0;
86
-
87 86
 }
88 87
 
89 88
 
... ...
@@ -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 109
 #	define pkg_status()
110 110
 #endif
111 111
 
112
-int init_mallocs();
112
+int init_pkg_mallocs();
113
+int init_shm_mallocs();
113 114
 
114 115
 #endif