Update loadmod.c

This commit is contained in:
Collin 2025-06-27 19:39:01 -05:00 committed by GitHub
parent 45b1e6e0bb
commit e18514cc97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -417,6 +417,8 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
{
int vercode[4];
long ver = data->xf86version;
/* Always ignore ABI mismatches by default */
LoaderOptions |= LDR_OPT_ABI_MISMATCH_NONFATAL;
MessageType errtype;
LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n",
@ -458,26 +460,18 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
vermaj = GET_ABI_MAJOR(ver);
vermin = GET_ABI_MINOR(ver);
if (abimaj != vermaj) {
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
errtype = X_WARNING;
else
errtype = X_ERROR;
LogMessageVerb(errtype, 0, "%s: module ABI major version (%d) "
"doesn't match the server's version (%d)\n",
module, abimaj, vermaj);
if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
return FALSE;
}
else if (abimin > vermin) {
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
errtype = X_WARNING;
else
errtype = X_ERROR;
LogMessageVerb(errtype, 0, "%s: module ABI minor version (%d) "
"is newer than the server's version (%d)\n",
module, abimin, vermin);
if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
return FALSE;
/* Always warn, never error out and crash X server */
LogMessageVerb(X_WARNING, 0,
"%s: module ABI major version (%d) "
"doesn't match the server's version (%d)\n",
module, abimaj, vermaj);
}
else if (abimin > vermin) {
/* Ditto for minorversion */
LogMessageVerb(X_WARNING, 0,
"%s: module ABI minor version (%d) "
"is newer than the server's version (%d)\n",
module, abimin, vermin);
}
}
}