Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Kristian Høgsberg
On Mon, May 13, 2013 at 11:41 PM, Othman, Ossama ossama.oth...@intel.com wrote: Hi Kristian, I think it's good to go - however, inlining the patch messed up the whitespace. Ideally, send patches using git send-email, which can be configured to use smtp servers, and you can pass --annotate if

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Othman, Ossama
Hi Kristian, I've attached the patch since the patch I sent through git send-mail was sent through an e-mail account that isn't subscribed to this list (waiting for moderator approval), and to make sure the spacing isn't munged again. This patch was generated against weston master as of this

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Kristian Høgsberg
On Tue, May 14, 2013 at 09:55:19AM -0700, Othman, Ossama wrote: Hi Kristian, I've attached the patch since the patch I sent through git send-mail was sent through an e-mail account that isn't subscribed to this list (waiting for moderator approval), and to make sure the spacing isn't munged

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Daniel Stone
Hi, On 12 May 2013 16:54, Kristian Høgsberg k...@bitplanet.net wrote: I think we can change the interface to int open_config_file(const char *), which looks up and opens the config file and returns the fd. We can keep that in weston_compositor instead of the config_file path. The parse

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Kristian Høgsberg
On Sun, May 12, 2013 at 07:33:44PM -0700, Othman, Ossama wrote: Hi Kristian, On Sun, May 12, 2013 at 8:54 AM, Kristian Høgsberg k...@bitplanet.netwrote: I think we can change the interface to int open_config_file(const char *), which looks up and opens the config file and returns the fd.

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Kristian Høgsberg
On Mon, May 13, 2013 at 10:37 AM, Daniel Stone dan...@fooishbar.org wrote: Hi, On 12 May 2013 16:54, Kristian Høgsberg k...@bitplanet.net wrote: I think we can change the interface to int open_config_file(const char *), which looks up and opens the config file and returns the fd. We can

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Kristian Høgsberg
On Mon, May 13, 2013 at 04:31:06PM -0700, Othman, Ossama wrote: Hi Kristian, Here's another revision of the patch that attempts to implement your suggested simplification, as well as address the TOCTOU race in previous revisions of the patch. The module entry point signature changed

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Othman, Ossama
I've revised the patch to build a list of possible filenames as Bill suggested. This time around I've included a patch for the man page, as well. Thanks! -Ossama --- Search for a given config file in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Kristian Høgsberg
On Sun, May 12, 2013 at 11:54 AM, Kristian Høgsberg k...@bitplanet.net wrote: Hi Ossama, I think we can change the interface to int open_config_file(const char *), which looks up and opens the config file and returns the fd. We can keep that in weston_compositor instead of the config_file

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Othman, Ossama
Hi Kristian, On Sun, May 12, 2013 at 8:54 AM, Kristian Høgsberg k...@bitplanet.netwrote: I think we can change the interface to int open_config_file(const char *), which looks up and opens the config file and returns the fd. We can keep that in weston_compositor instead of the config_file

[PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-10 Thread Othman, Ossama
Search 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. Signed-off-by: Ossama

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-10 Thread Bill Spitzak
Othman, Ossama wrote: Hi, Minor correction to my previous patch. This revision corrects a small leak in config_file_path_xdg_config_dirs(). Rather than have all these functions try to open the file, why not just build a list of all the possible filenames and then try to open them in