rt: Initialize mq_send input on tst-mqueue{5,6}

GCC with -Os warns that the mq_send input may be used uninitialized.
Although for the tests the data content sent is not important, since
both tests checks only if mq_notify was properly set, the warning is
correct and data is indeed uninitialized.

Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Adhemerval Zanella Netto 2022-09-21 10:51:06 -03:00 committed by Adhemerval Zanella
parent 442e3a2172
commit cbf24edbb3
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ rtmin_handler (int sig, siginfo_t *info, void *ctx)
static int
(mqsend) (mqd_t q, int line)
{
char c;
char c = 0;
if (mq_send (q, &c, 1, 1) != 0)
{
printf ("mq_send on line %d failed with: %m\n", line);

View File

@ -40,7 +40,7 @@
static int
(mqsend) (mqd_t q, int line)
{
char c;
char c = 0;
if (mq_send (q, &c, 1, 1) != 0)
{
printf ("mq_send on line %d failed with: %m\n", line);