[PATCH] init: allow to preserve init's command-line
Mike Frysinger
vapier at gentoo.org
Mon Feb 1 17:15:20 UTC 2016
On 01 Feb 2016 18:00, Nicolas CARRIER wrote:
> When launched as PID 1 and after parsing it's arguments, init wipes all
you'll want to run s/it's/its/ on the commit message and docs you added
to the help string. "it's" is short for "it is" while "its" is what you
want here -- the possessive form. because english!
> +//config: retrieved in /proc/1/cmdline on Linux, for example.
> +
>
these's no need to add this extra blank line
> +#if !ENABLE_FEATURE_PRESERVE_CMDLINE
> /* Make the command line just say "init" - thats all, nothing else */
> strncpy(argv[0], "init", strlen(argv[0]));
> /* Wipe argv[1]-argv[N] so they don't clutter the ps listing */
> while (*++argv)
> nuke_str(*argv);
> +#endif
we strongly prefer to *not* use CPP when we can do it in C.
write the code like i posted in the patch to you earlier.
if (!ENABLE_FEATURE_PRESERVE_CMDLINE) {
...
}
the compiler will optimize it the same way.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20160201/1a488f44/attachment.asc>
More information about the busybox
mailing list