summaryrefslogtreecommitdiff
path: root/src/cms-static.c
diff options
context:
space:
mode:
authorOssama Othman <ossama.othman@intel.com>2013-05-14 09:48:26 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-05-14 14:36:37 -0400
commita50e6e4c500e3080b8df7ec14c7e42741477a423 (patch)
tree0cae5b3f325814e7f2d859eaa3f2c2415c69eb33 /src/cms-static.c
parent95eb3a2eb470bd341ab078c7e48a28ffebc6dde1 (diff)
config-parser: Honor XDG_CONFIG_DIRS
This set of changes adds support for searching for a given config file in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config. This allows packages to install custom config files in /etc/xdg/weston, for example, thus allowing them to avoid dealing with home directories. To avoid a TOCTOU race the config file is actually open()ed during the search. Its file descriptor is returned and stored in the compositor for later use when performing subsequent config file parses. Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Diffstat (limited to 'src/cms-static.c')
-rw-r--r--src/cms-static.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cms-static.c b/src/cms-static.c
index be8e63eb..94fea99d 100644
--- a/src/cms-static.c
+++ b/src/cms-static.c
@@ -131,7 +131,7 @@ output_section_done(void *data)
WL_EXPORT int
module_init(struct weston_compositor *ec,
- int *argc, char *argv[], const char *config_file)
+ int *argc, char *argv[])
{
struct cms_static *cms;
struct weston_output *output;
@@ -157,7 +157,7 @@ module_init(struct weston_compositor *ec,
ARRAY_LENGTH(drm_config_keys), output_section_done },
};
- parse_config_file(config_file, config_section,
+ parse_config_file(ec->config_fd, config_section,
ARRAY_LENGTH(config_section), cms);
cms->destroy_listener.notify = cms_notifier_destroy;