Browse code

- get_max_procs() will log a bug and abort() if used too early (e.g. from mod_init())

Andrei Pelinescu-Onciul authored on 15/11/2006 19:57:42
Showing 2 changed files
... ...
@@ -67,7 +67,7 @@ MAIN_NAME=ser
67 67
 VERSION = 0
68 68
 PATCHLEVEL = 10
69 69
 SUBLEVEL =   99
70
-EXTRAVERSION = -dev57-tm_fixes
70
+EXTRAVERSION = -dev58
71 71
 
72 72
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
73 73
 			$(SUBLEVEL) )
... ...
@@ -115,6 +115,11 @@ int register_procs(int no)
115 115
 /* returns the maximum number of processes */
116 116
 int get_max_procs()
117 117
 {
118
+	if (pt==0){
119
+		LOG(L_CRIT, "BUG: get_max_procs() called too early "
120
+				"(it must _not_ be called from mod_init())\n");
121
+		abort(); /* crash to quickly catch offenders */
122
+	}
118 123
 	return estimated_proc_no;
119 124
 }
120 125