[LTP] [PATCH v4 3/3] API: Remove TST_ERR usage from rtnetlink/netdevice
Cyril Hrubis
chrubis@suse.cz
Tue Jun 15 15:29:38 CEST 2021
Hi!
> The test author is guaranteed that the library will not set TST_ERR
> except via the TEST macro and similar.
>
> Currently the rtnetlink & netdevice API returns 0 on fail and 1 on
> success. Either TST_ERR or errno is used to store the error
> number. The commit stays with this scheme except that we only use
> errno. This means that we have to temporarily save errno when it would
> be overwritten by a less important operation.
I do not like this fix. If nothing else it's fragile and would make any
patch review for these libraries much harder.
I would prefer having these functions modified to return the errors
instead even if I have to do the work.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list