Re: [hackers] [slock] Use argv0 instead of passing "slock:" to die every time || FRIGN

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Mon, 15 Feb 2016 11:40:17 +0100

FRIGN wrote:
> we came up with this in sbase/ubase as an idiomatic way to set argv0
> for tools that don't use arg.h.
> We need argv0 here because I moved the prepending of the argv[0] into
> die(), and thus we need to store the argv0 in a global variable.

Heyho frign,

sure, but I asked why you would *shift* argc and argv right at the start of
main. If someone reads just the fork exec part and assumes argv[0] is `slock`,
this is confusing and forcing the reader to search for the place where argv is
changed.

--Markus
Received on Mon Feb 15 2016 - 11:40:17 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 15 2016 - 11:48:28 CET