All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Perrine Martignoni <perrmart@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Problem with Message queue
Date: Mon, 14 May 2007 13:04:09 +0200	[thread overview]
Message-ID: <17992.16937.797697.933278@domain.hid> (raw)
In-Reply-To: <7289437c0705140221tb124a04mcbf9910e47d3ac2e@domain.hid>

Perrine Martignoni wrote:
 > Hello,
 > 
 > I'm writing an application using Message queue and mq_send returns the errno
 > value EBADF.
 > I don't understand what I'm doing wrong, I need some help.
 > 
 > Here's my code :

Next time, please do not omit the #includes, I need them to compile your
program.

 > (...)
 >             if (mq1=mq_open("/mq1", O_CREAT|O_RDWR, 0, &qattr1) ==
 > (mqd_t)(-1)) {

Here gcc gives the following message:
test_mq.c:186: warning: suggest parentheses around assignment used as truth value

Which should be the sign that something is not correct, 

a=b == c is interpreted by the compiler as a=(b == c), whereas you would
like
(a = b) == c.

So, add the parentheses, and everything should work fine.

However, I do not understand what your program is supposed to do, here
it dies without printing anything.

-- 


					    Gilles Chanteperdrix.


  parent reply	other threads:[~2007-05-14 11:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14  9:21 [Xenomai-help] Problem with Message queue Perrine Martignoni
2007-05-14  9:51 ` Gilles Chanteperdrix
2007-05-14 11:04 ` Gilles Chanteperdrix [this message]
2007-05-14 11:57   ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2007-05-14 12:11 Fillod Stephane
2007-05-14 13:36 ` Gilles Chanteperdrix
2007-05-14 19:16 ` Gilles Chanteperdrix
2007-05-15  8:00   ` Perrine Martignoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17992.16937.797697.933278@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=perrmart@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.