diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2008-02-26 16:50:51 -0800 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2008-02-26 16:50:51 -0800 |
commit | e6b6ff7786821e1f8870d8061c22061030b2d2c6 (patch) | |
tree | 115dbbe573a3e0aa2589e50fe1fb74078086b048 | |
parent | 08bcb766cb10d8b6e2c1fa30e9d7738cc1da02e8 (diff) |
-rw-r--r-- | XF86Config-parser/Write.c | 16 | ||||
-rw-r--r-- | make_usable.c | 14 |
2 files changed, 21 insertions, 9 deletions
diff --git a/XF86Config-parser/Write.c b/XF86Config-parser/Write.c index 12d78f7..98b1dd6 100644 --- a/XF86Config-parser/Write.c +++ b/XF86Config-parser/Write.c @@ -98,13 +98,17 @@ int xconfigWriteConfigFile (const char *filename, XConfigPtr cptr) xconfigPrintLayoutSection (cf, cptr->layouts); - fprintf (cf, "Section \"Files\"\n"); - xconfigPrintFileSection (cf, cptr->files); - fprintf (cf, "EndSection\n\n"); + if (cptr->files) { + fprintf (cf, "Section \"Files\"\n"); + xconfigPrintFileSection (cf, cptr->files); + fprintf (cf, "EndSection\n\n"); + } - fprintf (cf, "Section \"Module\"\n"); - xconfigPrintModuleSection (cf, cptr->modules); - fprintf (cf, "EndSection\n\n"); + if (cptr->modules) { + fprintf (cf, "Section \"Module\"\n"); + xconfigPrintModuleSection (cf, cptr->modules); + fprintf (cf, "EndSection\n\n"); + } xconfigPrintVendorSection (cf, cptr->vendors); diff --git a/make_usable.c b/make_usable.c index 731672b..5617e4c 100644 --- a/make_usable.c +++ b/make_usable.c @@ -69,9 +69,17 @@ int update_modules(XConfigPtr config) { XConfigLoadPtr load, next; - if (config->modules == NULL) { - config->modules = xconfigAlloc(sizeof(XConfigModuleRec)); - } + /* + * Return early if the original X configuration file lacked a + * "Module" section, and rely on the server's builtin list + * of modules to load, instead. We can safely do this if the + * X server is an X.Org server or XFree86 release >= 4.4.0. On + * installations with older XFree86 servers, the vendor's X + * configuration utility should have added a "Module" section + * we can extend, if necessary. + */ + if (config->modules == NULL) + return FALSE; /* make sure all our required modules are loaded */ ensure_module_loaded(config, "glx"); |