From 51fa7562e2af0aa43078f3b4ec21ce660efd6338 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 27 Jun 2003 00:00:48 +0000 Subject: 2003-06-26 Jeff Johnston * libc/sys/linux/mq_open.c (mq_open): Must allocate rdbuf and wrbuf for a non-creating open. --- newlib/ChangeLog | 5 +++++ newlib/libc/sys/linux/mq_open.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 82bebfdb0..e516a783a 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2003-06-26 Jeff Johnston + + * libc/sys/linux/mq_open.c (mq_open): Must allocate rdbuf and + wrbuf for a non-creating open. + 2003-06-24 Kazu Hirata * libc/machine/h8300/setarch.h: New. diff --git a/newlib/libc/sys/linux/mq_open.c b/newlib/libc/sys/linux/mq_open.c index 744cb9eaa..0e6b95345 100644 --- a/newlib/libc/sys/linux/mq_open.c +++ b/newlib/libc/sys/linux/mq_open.c @@ -210,7 +210,11 @@ mq_open (const char *name, int oflag, ...) } } else /* just open it */ - msgqid = msgget (key, 0); + { + msgqid = msgget (key, 0); + wrbuf = (MSG *)malloc (attr->mq_msgsize + sizeof(int)); + rdbuf = (MSG *)malloc (attr->mq_msgsize + sizeof(int)); + } /* release semaphore acquired earlier */ sb.sem_op = 1; -- cgit v1.2.3