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

Bryce W. Harrington b.harrington at samsung.com
Thu Mar 20 22:53:22 PDT 2014


On Wed, Mar 19, 2014 at 09:19:03AM +0200, Pekka Paalanen wrote:
> On Wed, 19 Mar 2014 00:21:20 +0100
> Hardening <rdp.effort at gmail.com> wrote:
> 
> > Le 18/03/2014 20:34, Bryce W. Harrington a écrit :
> > > 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>
> > > ---
> > >   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");
> > 
> > perror writes a human readable message, perhaps
> > weston_log("could not create an anonymous file buffer: %s\n", 
> > strerror(error));
> > 
> > would be better ?
> 
> Yeah. FWIW, all of weston seems to use the glibc extension "%m" as a
> shorthand.

Ah, sounds good.  Thanks for the review, will respin the patch directly.

Bryce

> 
> Thanks,
> pq
> _______________________________________________
> 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