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

Cyrill Gorcunov gorcunov at gmail.com
Fri Sep 19 07:59:56 PDT 2014


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, so I think it's safe to fetch them early before any other processing.


More information about the CRIU mailing list