[LTP] [PATCH v2 2/5] syscalls/ipc: add newipc library for new API

Cyril Hrubis chrubis@suse.cz
Mon Dec 12 16:10:37 CET 2016


Hi!
> > +void rm_queue(int queue_id)
> > +{
> > +	if (queue_id == -1)
> > +		return;
> > +
> > +	if (msgctl(queue_id, IPC_RMID, NULL) == -1) {
> > +		tst_res(TINFO, "WARNING: message queue deletion failed.");
>                          ^
> 			 This really should be TWARN, even the message
> 			 includes 'WARNING' in the string. And we should
> 			 include errno with TERRNO as well.
> 
> 			 Or even better we should exit the test with
> 			 TBROK here.

I see that these functions are used in the cleanup, hence TWARN is the
one that should be used here.

But even so, why can't we just do:

if (queue_id != -1 && msgctl(queue_id, IPC_RMID, NULL))
	tst_res(TWARN | TERRNO, "Failed to delete message queue %i", queue_id);

In the test cleanup?

Is this really worth of creating a library function?

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list