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