[PATCH] compositor: Use weston_log rather than perror for error messages

Kristian Høgsberg hoegsberg at gmail.com
Tue Apr 1 16:31:07 PDT 2014


On Tue, Mar 18, 2014 at 07:34:56PM +0000, Bryce W. Harrington wrote:
> weston_log() seems to be the standard elsewhere in the codebase for
> errors.  These are the only two instances where perror() is used
> instead, and their error messages aren't that informative anyway.
> 
> Signed-off-by: Bryce Harrington <b.harrington at samsung.com>

Thanks Bryce, that makes sense.

Kristian

> ---
>  src/compositor-wayland.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index 238946b..83eb59c 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -211,13 +211,13 @@ wayland_output_get_shm_buffer(struct wayland_output *output)
>  
>  	fd = os_create_anonymous_file(height * stride);
>  	if (fd < 0) {
> -		perror("os_create_anonymous_file");
> +		weston_log("could not create an anonymous file buffer\n");
>  		return NULL;
>  	}
>  
>  	data = mmap(NULL, height * stride, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
>  	if (data == MAP_FAILED) {
> -		perror("mmap");
> +		weston_log("could not mmap %d memory for data\n", height * stride);
>  		close(fd);
>  		return NULL;
>  	}
> -- 
> 1.7.9.5
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list