[LTP] [PATCH V2 01/10] tst_device: Add tst_ismount() helper

Petr Vorel pvorel@suse.cz
Thu Feb 20 08:52:52 CET 2020


Hi,

...
> > Sorry, I think the return value should be '1' if it has been mounted
> > already.

> > e.g
> > These codes will make people confused about whether it's
> > mounted successfully or not.

> > if (tst_ismount(MNTPOINT))
> >         tst_brk(TBROK | TERRNO, "device not mounted");

> I kept the return 0 on success thing here as well, but maybe yeah, it
> should return 1 on success here.

Most of the functions returns 1 or -1 on failure. But here it's this approach
really confusing, because the name and purpose. So I'd also be for 0 on failure and 1
on success.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr


More information about the ltp mailing list