Browse code

exit on version mismatch

Jiri Kuthan authored on 29/06/2003 20:19:35
Showing 1 changed files
... ...
@@ -160,17 +160,17 @@ static inline int version_control(void *handle, char *path)
160 160
 
161 161
 	m_ver=(char **)dlsym(handle, DLSYM_PREFIX "module_version");
162 162
 	if ((error=(char *)dlerror())!=0) {
163
-		LOG(L_WARN, "WARNING: no version info in module <%s>: %s\n",
163
+		LOG(L_ERR, "ERROR: no version info in module <%s>: %s\n",
164 164
 			path, error );
165 165
 		return 0;
166 166
 	}
167 167
 	if (!m_ver || !(*m_ver)) {
168
-		LOG(L_WARN, "WARNING: no version in module <%s>\n", path );
168
+		LOG(L_ERR, "ERROR: no version in module <%s>\n", path );
169 169
 		return 0;
170 170
 	}
171 171
 	if (strcmp(VERSION,*m_ver)==0)
172 172
 		return 1;
173
-	LOG(L_WARN, "WARNING: module version mismatch for %s; "
173
+	LOG(L_ERR, "ERRO: module version mismatch for %s; "
174 174
 		"core: %s; module: %s\n", path, VERSION, *m_ver );
175 175
 	return 0;
176 176
 }
... ...
@@ -202,7 +202,9 @@ int load_module(char* path)
202 202
 		}
203 203
 	}
204 204
 	/* version control */
205
-	version_control(handle, path);
205
+	if (!version_control(handle, path)) {
206
+		exit(0);
207
+	}
206 208
 	/* launch register */
207 209
 	exp = (struct module_exports*)dlsym(handle, DLSYM_PREFIX "exports");
208 210
 	if ( (error =(char*)dlerror())!=0 ){