summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-07-16 21:00:06 -0700
committerAaron Plattner <aplattner@nvidia.com>2008-07-16 21:00:06 -0700
commit958b276b42da97368a70d01616a6e2840ab60d8e (patch)
tree8e596f928784eb528fff52084ead972ec8ea0237
parentc139f90b4fdfa9bb819ef6fe8795651cd8266879 (diff)
96.43.0796.43.07
-rw-r--r--XF86Config-parser/Write.c16
-rw-r--r--make_usable.c14
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 920a7dc..19b0508 100644
--- a/make_usable.c
+++ b/make_usable.c
@@ -50,9 +50,17 @@ int update_modules(XConfigPtr config)
XConfigLoadPtr load, next;
int found;
- 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 glx is loaded */