[PATCH] compositor: change position of weston_log_file_open call

Kristian Høgsberg hoegsberg at gmail.com
Mon Jun 11 06:37:31 PDT 2012


On Sat, Jun 09, 2012 at 03:10:28PM +0200, Rafal Mielniczuk wrote:
> In case XDG_RUNTIME_DIR was not set, weston_log
> will crash the compositor instead of spitting
> error msg, as weston log was not yet opened

Ah, yes, not good.  Committed.
Kristian

> ---
>  src/compositor.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/compositor.c b/src/compositor.c
> index 700f31b..0230de8 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -3162,13 +3162,13 @@ int main(int argc, char *argv[])
>  	argc = parse_options(core_options,
>  			     ARRAY_LENGTH(core_options), argc, argv);
>  
> +	weston_log_file_open(log);
> +	
>  	if (!getenv("XDG_RUNTIME_DIR")) {
>  		weston_log(xdg_error_message);
>  		exit(EXIT_FAILURE);
>  	}
>  
> -	weston_log_file_open(log);
> -
>  	gettimeofday(&tv, NULL);
>  	brokendown_time = localtime(&tv.tv_sec);
>  	strftime(buffer, sizeof buffer, "%Y-%m-%d %H:%M:%S", brokendown_time);
> -- 
> 1.7.10.4
> 


More information about the wayland-devel mailing list