[PATCH] init: allow to preserve init's command-line

Nicolas CARRIER carrier.nicolas0 at gmail.com
Mon Feb 1 18:09:01 UTC 2016


Thank you for all your comments.
Please find a new version attached.

2016-02-01 18:15 GMT+01:00 Mike Frysinger <vapier at gentoo.org>:
> 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: 0001-init-allow-to-preserve-init-s-command-line.patch
Type: text/x-patch
Size: 2603 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20160201/01296a22/attachment.bin>


More information about the busybox mailing list