Re: [PATCH 2/3] perf hists browser: Add option for runtime switchingperf data file

From: Feng Tang
Date: Tue Nov 20 2012 - 11:17:13 EST


Hi Arnaldo,

On Tue, Nov 20, 2012 at 12:16:44PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 20, 2012 at 05:31:16PM +0800, Feng Tang escreveu:
> > +static int switch_data_file(void)
> > +{
> > + char *pwd, *options[32], *abs_path[32], *tmp;
> > + DIR *pwd_dir;
> > + int nr_options = 0, choice = -1, ret = -1;
> > +
>
> no need for this empty line
>
> > + while ((dent = readdir(pwd_dir))) {
> > + char path[PATH_MAX];
> > + u64 magic;
> > + char *name = dent->d_name;
> > + FILE *file;
> > +
> > + if (!(dent->d_type == DT_REG))
> > + continue;
> > +
> > + snprintf(path, PATH_MAX, "%s/%s", pwd, name);
>
> sizeof(path)

Thanks for the review, here is the updated one: