Skip to content

Commit 6fc2b9f

Browse files
committed
modules: minimum match for revision control
(cherry picked from commit 9f78fd0)
1 parent 31a8c85 commit 6fc2b9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sr_module.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ static inline int version_control(const struct module_exports* exp, char *path)
206206
{
207207
const char *hint = "(try `make clean all modules' and reinstall everything)";
208208
const char *scm_nm = "version control system";
209+
int len;
209210
if ( !exp->ver_info.version ) {
210211
LM_CRIT("BUG - version not defined in module <%s>\n", path );
211212
return 0;
@@ -242,7 +243,9 @@ static inline int version_control(const struct module_exports* exp, char *path)
242243
core_scm_ver.type, exp->ver_info.scm.type, hint);
243244
return 0;
244245
}
245-
if (strcmp(core_scm_ver.rev, exp->ver_info.scm.rev) != 0) {
246+
len = (strlen(core_scm_ver.rev) < strlen(exp->ver_info.scm.rev))?
247+
strlen(core_scm_ver.rev): strlen(exp->ver_info.scm.rev);
248+
if (strncmp(core_scm_ver.rev, exp->ver_info.scm.rev, len) != 0) {
246249
LM_CRIT("module %s revision mismatch for %s "
247250
" \ncore: %s \nmodule: %s %s\n", scm_nm, exp->name,
248251
core_scm_ver.rev, exp->ver_info.scm.rev, hint);

0 commit comments

Comments
 (0)