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.

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to