<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br></div><div class="gmail_extra"><div class="gmail_quote">On 30 September 2016 at 11:10, Eric Engestrom <span dir="ltr"><<a href="mailto:eric.engestrom@imgtec.com" target="_blank">eric.engestrom@imgtec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Sep 29, 2016 at 09:26:16PM +0100, Murray Calavera wrote:<br>
> error.h is a gnu extension and not available in other<br>
> popular libcs like musl. This patch provides a replacement.<br>
><br>
> Signed-off-by: Murray Calavera <<a href="mailto:murray.calavera@gmail.com">murray.calavera@gmail.com</a>><br>
<br>
</span>How did you test this? For me, `CC=musl-gcc ./autogen.sh` stops on:<br>
[...]<br>
checking for library containing pam_open_session... no<br>
configure: error: weston-launch requires pam<br></blockquote><div> </div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Have you got libpam installed?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">I don't see how this patch could have affected the configure,</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">does it configure without this patch?</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The code looks good though (with one nit-pick), so even if I couldn't<br>
test it, it is:<br>
Reviewed-by: Eric Engestrom <<a href="mailto:eric.engestrom@imgtec.com">eric.engestrom@imgtec.com</a>><br>
<div><div class="h5"><br>
> ---<br>
> libweston/weston-launch.c | 20 +++++++++++++++++++-<br>
> 1 file changed, 19 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c<br>
> index 140fde1..84f7d60 100644<br>
> --- a/libweston/weston-launch.c<br>
> +++ b/libweston/weston-launch.c<br>
> @@ -33,7 +33,6 @@<br>
> #include <poll.h><br>
> #include <errno.h><br>
><br>
> -#include <error.h><br>
> #include <getopt.h><br>
><br>
> #include <sys/types.h><br>
> @@ -112,6 +111,25 @@ struct weston_launch {<br>
><br>
> union cmsg_data { unsigned char b[4]; int fd; };<br>
><br>
> +static void<br>
> +error(int status, int errnum, const char *msg, ...)<br>
> +{<br>
> + va_list args;<br>
> +<br>
> + fputs("weston-launch: ", stderr);<br>
> + va_start(args, msg);<br>
> + vfprintf(stderr, msg, args);<br>
> + va_end(args);<br>
> +<br>
> + if (errnum)<br>
> + fprintf(stderr, ": %s\n", strerror(errnum));<br>
> + else<br>
> + fputc('\n', stderr);<br>
<br>
</div></div>Why not `fprintf(stderr, "\n");`?<br>
While fputc() is enough since this is a single char, the use of<br>
a different function here looks... odd.<br></blockquote><div><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">As you said, because I'm not printing formatted data</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">there is no need to use printf.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">However if the consensus here is to use printf even</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">when not needed, I can change that.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
> +<br>
> + if (status)<br>
> + exit(status);<br>
> +}<br>
> +<br>
> static gid_t *<br>
> read_groups(void)<br>
> {<br>
> --<br>
> 2.10.0<br>
</div></div></blockquote></div><br></div></div>