Re: [PATCH v7 6/9] trace-cmd: Find and store pids of tasks, which run virtual CPUs of given VM

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

 



On Tue, 19 Mar 2019 16:35:28 +0000
Slavomir Kaslev <kaslevs@xxxxxxxxxx> wrote:

> > +
> > +       snprintf(path, sizeof(path), "/proc/%s/task", guest_task);
> > +       dir = opendir(path);
> > +       if (!dir)
> > +               return;
> > +
> > +       for (entry_t = readdir(dir); entry_t; entry_t = readdir(dir)) {  
> 
> Nit:  `while ((entry = readdir(dir))) {` is more common throughout the code.

Agreed. Although in a lot of cases I prefer for() over while(), in this
case, when the initialization is identical to the next iteration, the
while() is preferred.

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux