[LTP] [PATCH v2 1/7] Add more safe macros for mqueue API
Andrea Cervesato
andrea.cervesato@suse.com
Fri Jul 22 11:31:24 CEST 2022
Hi!
On 6/16/22 23:57, Petr Vorel wrote:
> Hi Andrea,
>
> ...
>>> +static inline int safe_mq_close(const char *file, const int lineno,
>>> + mqd_t __mqdes)
>>> +{
>>> + int rval;
>>> +
>>> + rval = mq_close(__mqdes);
>>> +
>>> + if (rval == -1) {
>>> + tst_brk_(file, lineno, TBROK | TERRNO,
>>> + "mq_close(%d) failed", __mqdes);
>>> + }
>> How about check for invalid return value?
>> } else if (rval < 0) {
>> tst_brk_(file, lineno, TBROK | TERRNO,
>> "Invalid mq_close(%d) return value %d", __mqdes, rval);
>> }
> Also safe_mq_open() could have check for invalid return value.
>
It's already like that, Isn't it?
> Kind regards,
> Petr
Andrea
More information about the ltp
mailing list