xorg-server-1.12-unloadsubmodule.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. diff -u13 -r xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c xorg-server-1.12.3/hw/xfree86/loader/loadmod.c
  2. --- xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c 2012-09-05 18:26:42.000000000 +0200
  3. +++ xorg-server-1.12.3/hw/xfree86/loader/loadmod.c 2012-09-05 18:28:54.000000000 +0200
  4. @@ -1109,39 +1109,38 @@
  5. static void
  6. RemoveChild(ModuleDescPtr child)
  7. {
  8. ModuleDescPtr mdp;
  9. ModuleDescPtr prevsib;
  10. ModuleDescPtr parent;
  11. if (!child->parent)
  12. return;
  13. parent = child->parent;
  14. if (parent->child == child) {
  15. parent->child = child->sib;
  16. - return;
  17. - }
  18. -
  19. - prevsib = parent->child;
  20. - mdp = prevsib->sib;
  21. - while (mdp && mdp != child) {
  22. - prevsib = mdp;
  23. - mdp = mdp->sib;
  24. + }
  25. + else {
  26. + prevsib = parent->child;
  27. + mdp = prevsib->sib;
  28. + while (mdp && mdp != child) {
  29. + prevsib = mdp;
  30. + mdp = mdp->sib;
  31. + }
  32. + if (mdp == child)
  33. + prevsib->sib = child->sib;
  34. }
  35. - if (mdp == child)
  36. - prevsib->sib = child->sib;
  37. child->sib = NULL;
  38. - return;
  39. }
  40. void
  41. LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
  42. {
  43. const char *msg;
  44. MessageType type = X_ERROR;
  45. switch (errmaj) {
  46. case LDR_NOERROR:
  47. msg = "no error";
  48. break;
  49. case LDR_NOMEM: