Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> GIT version control wrote:
>>> +void xnheap_set_label(xnheap_t *heap, const char *label, ...)
>>> +{
>>> +   va_list args;
>>> +   spl_t s;
>>> +
>>> +   va_start(args, label);
>>> +
>>> +   xnlock_get_irqsave(&nklock, s);
>>> +   vsnprintf(heap->label, sizeof(heap->label), label, args);
>>> +   xnlock_put_irqrestore(&nklock, s);
>> Why do we need locking here ?
>>
> 
> We already registered the heap, so I want to avoid that someone dumping
> /proc sees an inconsistent string - or even an unterminated one.

There are other ways to avoid that, but, I am over-reacting to printf.
But it is not really a printf, it is an snprintf, which is not that heavy.

-- 
                                          Gilles


_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to