[LTP] [PATCH v1] libswap.c: Improve caculate swap dev number

Petr Vorel pvorel@suse.cz
Mon Mar 4 10:04:24 CET 2024


> On Sun, Mar 3, 2024 at 9:14 PM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi Wei, Xu,

> > > Hi  Wei

> > > > I encounter a dead loop on following code in our test on ppc64 machine:
> > > > while ((c = fgetc(fp)) != EOF)

> > > > I think "/proc/swaps" is not normal file and can not get EOF in some
> > situation,
> > > > so i use fgets a line and caculate swap dev number.

> > I guess the problem has been fixed by another patch [1], thus closing it in
> > patchwork. Please let me know if not.


> Seems not, the patch [1] below is mainly to count the free disk size.

> But Wei's work here is to calculate swap-dev numbers correctly
> (especially get rid of EOF affection to some degree).

OK, setting it as "New" again.

Kind regards,
Petr

> Xu Yang, what do you think? or did I miss anything here?


More information about the ltp mailing list