[LTP] [PATCH] open04.c: convert to new LTP API
Petr Vorel
pvorel@suse.cz
Thu Sep 1 22:49:17 CEST 2022
Hi Avinesh,
> > I suggest to merge with these fixes:
> > * added free (if needed - that was in the original source)
> > * fixed cleanup (don't run SAFE_CLOSE() if previous SAFE_OPEN() or SAFE_MALLOC()
> > failed)
> > * use TST_EXP_FAIL() - the same result as TST_EXP_FAIL2() with shorter code
> TST_EXP_FAIL2() is correct here as you mentioned in previous reply.
> > * allocate memory needed (it's actually -2)
> fds_limit(1024) - first(3) is correct as we need to allocate memory for1021 int fds.
> Test executes fine even with (fds_limit - first - 2) probably because malloc allocating
> more than requested memory.
Yes, thank you for correcting me, I forget the basic (the alignment of
dynamically allocating memory).
> > * #define FNAME "open04"
> > If it's ok, I'll merge it.
> please go ahead and merge with rest of the suggestions, or let me know if I should
> sent v2.
Merged, thanks!
Kind regards,
Petr
More information about the ltp
mailing list