[CRIU] [PATCH] env: Introduce logging of runtime environment

Pavel Emelyanov xemul at parallels.com
Fri Sep 19 08:03:33 PDT 2014


On 09/19/2014 06:59 PM, Cyrill Gorcunov wrote:
> On Fri, Sep 19, 2014 at 05:51:15PM +0400, Pavel Emelyanov wrote:
>> On 09/17/2014 11:22 AM, Cyrill Gorcunov wrote:
>>
>>> +void log_rt_env(unsigned int loglevel)
>>> +{
>>> +	if (pr_quelled(loglevel))
>>> +		return;
>>> +
>>> +	print_on_level(loglevel, "Run time environment info\n");
>>> +	print_on_level(loglevel, "  Command line: %s\n", rt_env.cmdline);
>>> +}
>>> +
>>> +int fill_rt_env(int argc, char *argv[])
>>
>> Why do we need pre-fill? The getopt_long rearranges options, but
>> doesn't eat them :)
> 
> Well, I not sure if it's guaranteed that argv and argc will remain
> intact,

It is. The getopt_long only reshuffles them.

> so I think it's safe to fetch them early before any other processing.
> .
> 



More information about the CRIU mailing list