* posix_ipc.cc (mq_open): Avoid compiler warning. Initialize mqhdr

before using it in file exists case.
	* include/mqueue.h (mqd_t): Make non-pointer type.
This commit is contained in:
Corinna Vinschen 2007-02-15 17:49:25 +00:00
parent 93162be554
commit eb8a6636bf
3 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2007-02-15 Corinna Vinschen <corinna@vinschen.de>
* posix_ipc.cc (mq_open): Avoid compiler warning. Initialize mqhdr
before using it in file exists case.
* include/mqueue.h (mqd_t): Make non-pointer type.
2007-02-15 Corinna Vinschen <corinna@vinschen.de> 2007-02-15 Corinna Vinschen <corinna@vinschen.de>
* posix_ipc.cc (ipc_mutex_init): Create global object name. * posix_ipc.cc (ipc_mutex_init): Create global object name.

View File

@ -18,7 +18,7 @@
__BEGIN_DECLS __BEGIN_DECLS
typedef void *mqd_t; typedef intptr_t mqd_t;
struct mq_attr { struct mq_attr {
long mq_flags; /* Message queue flags */ long mq_flags; /* Message queue flags */

View File

@ -279,7 +279,7 @@ mq_open (const char *name, int oflag, ...)
{ {
int i, fd, nonblock, created; int i, fd, nonblock, created;
long msgsize, index; long msgsize, index;
_off64_t filesize; _off64_t filesize = 0;
va_list ap; va_list ap;
mode_t mode; mode_t mode;
int8_t *mptr; int8_t *mptr;
@ -427,7 +427,7 @@ exists:
/* Allocate one mq_info{} for each open */ /* Allocate one mq_info{} for each open */
if (!(mqinfo = (struct mq_info *) malloc (sizeof (struct mq_info)))) if (!(mqinfo = (struct mq_info *) malloc (sizeof (struct mq_info))))
goto err; goto err;
mqinfo->mqi_hdr = (struct mq_hdr *) mptr; mqinfo->mqi_hdr = mqhdr = (struct mq_hdr *) mptr;
mqinfo->mqi_magic = MQI_MAGIC; mqinfo->mqi_magic = MQI_MAGIC;
mqinfo->mqi_flags = nonblock; mqinfo->mqi_flags = nonblock;