On 14 February 2016 at 02:14,  <g...@suckless.org> wrote:
> commit b02c4d452a7942d4be3c69e6f98dafd35a2e4e78
> Author:     FRIGN <d...@frign.de>
> AuthorDate: Sun Feb 14 02:13:54 2016 +0100
> Commit:     FRIGN <d...@frign.de>
> CommitDate: Sun Feb 14 02:13:54 2016 +0100
>
>     Use argv0 instead of passing "slock:" to die every time
>
> diff --git a/slock.c b/slock.c
> index 4531f95..a0ffed0 100644
> --- a/slock.c
> +++ b/slock.c
> @@ -46,6 +46,7 @@ static Bool failure = False;
>  static Bool rr;
>  static int rrevbase;
>  static int rrerrbase;
> +static char *argv0;
>
>  static void
>  die(const char *errstr, ...)
> @@ -53,6 +54,7 @@ die(const char *errstr, ...)
>         va_list ap;
>
>         va_start(ap, errstr);
> +       fprintf(stderr, "%s: ", argv0);

I don't like this approach. Code should always output the original
name of the program, not the name of the process.

When someone renames slock into foo, then I cannot assert anymore what
it really is all about, if I query ./foo -v or ./foo -h

I'm for reverting to the original approach here -- btw. same for all
other suckless tools.

BR,
Anselm

Reply via email to