summaryrefslogtreecommitdiff
path: root/hw/xwin/winconfig.c
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2009-12-21 01:13:44 -0800
committerDan Nicholson <dbn.lists@gmail.com>2009-12-22 23:20:52 -0800
commit592b20c517461d32daf44a940386ffcc11c434f8 (patch)
treed20c89e68fe9fb9b7a55d013b327535c3dd2cebe /hw/xwin/winconfig.c
parentefa5269f23c2237eb5368bf5245ffbbf35714153 (diff)
xfree86: Allow config directory to be specified on command line
Add a new command line parameter, -configdir, to specify the config directory to be used. Rules are the same as -config for root vs. user privileges. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Diffstat (limited to 'hw/xwin/winconfig.c')
-rw-r--r--hw/xwin/winconfig.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index 6efd7cae8..f1e805c4c 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -64,6 +64,7 @@ XF86ConfigPtr g_xf86configptr = NULL;
WinCmdlineRec g_cmdline = {
#ifdef XWIN_XF86CONFIG
NULL, /* configFile */
+ NULL, /* configDir */
#endif
NULL, /* fontPath */
#ifdef XWIN_XF86CONFIG
@@ -117,19 +118,26 @@ winReadConfigfile ()
{
Bool retval = TRUE;
const char *filename, *dirname;
- MessageType from = X_DEFAULT;
+ MessageType filefrom = X_DEFAULT;
+ MessageType dirfrom = X_DEFAULT;
char *xf86ConfigFile = NULL;
+ char *xf86ConfigDir = NULL;
if (g_cmdline.configFile)
{
- from = X_CMDLINE;
+ filefrom = X_CMDLINE;
xf86ConfigFile = g_cmdline.configFile;
}
+ if (g_cmdline.configDir)
+ {
+ dirfrom = X_CMDLINE;
+ xf86ConfigDir = g_cmdline.configDir;
+ }
/* Parse config file into data structure */
xf86initConfigFiles();
filename = xf86openConfigFile (CONFIGPATH, xf86ConfigFile, PROJECTROOT);
- dirname = xf86openConfigDirFiles (CONFIGDIRPATH, NULL, PROJECTROOT);
+ dirname = xf86openConfigDirFiles (CONFIGDIRPATH, xf86ConfigDir, PROJECTROOT);
/* Hack for backward compatibility */
if (!filename && from == X_DEFAULT)
@@ -150,6 +158,13 @@ winReadConfigfile ()
{
winMsg (from, "Using config directory: \"%s\"\n", dirname);
}
+ else
+ {
+ winMsg (X_ERROR, "Unable to locate/open config directory");
+ if (xf86ConfigDir)
+ ErrorF (": \"%s\"", xf86ConfigDir);
+ ErrorF ("\n");
+ }
if (!filename && !dirname)
{
return FALSE;