Re: [PATCH] run-command: introduce CHILD_PROCESS_INIT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 17, 2014 at 12:55:23AM +0200, René Scharfe wrote:

> Most struct child_process variables are cleared using memset right after
> declaration.  Provide a macro, CHILD_PROCESS_INIT, that can be used to
> initialize them statically instead.  That's shorter, doesn't require a
> function call and is slightly more readable (especially given that we
> already have similar macros like STRBUF_INIT, ARGV_ARRAY_INIT etc.).

I think one reason we never had an INIT macro here is that you cannot
simply use the struct after zero-ing it anyway. That's just the first
step, and then you have to tweak a bunch of fields to get what you want.
So the memset is just one setup line out of many.

Still, I think this is probably an improvement for the reasons you give
above, and we can still memset() in any cases where it makes sense.

Patch itself looks obviously correct.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]