diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-02-15 20:49:25 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-02-15 20:49:25 +0300 |
commit | eb8a6636bfd7e9cbc7f8ce2c774334a61385992e (patch) | |
tree | 80970641744a4697b6608e29502ce00a4aa73538 /winsup | |
parent | 93162be554b758a64cd35cfdea61fa1c7a1f8c3f (diff) |
* 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.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/include/mqueue.h | 2 | ||||
-rw-r--r-- | winsup/cygwin/posix_ipc.cc | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4e29c989d..af9fc2617 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,11 @@ 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> + * posix_ipc.cc (ipc_mutex_init): Create global object name. (ipc_cond_init): Ditto. (struct mq_hdr): Add mqh_uname member to store synchronization object diff --git a/winsup/cygwin/include/mqueue.h b/winsup/cygwin/include/mqueue.h index 804a80919..59c32dbe4 100644 --- a/winsup/cygwin/include/mqueue.h +++ b/winsup/cygwin/include/mqueue.h @@ -18,7 +18,7 @@ __BEGIN_DECLS -typedef void *mqd_t; +typedef intptr_t mqd_t; struct mq_attr { long mq_flags; /* Message queue flags */ diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index a0a38d2fc..c286b2483 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -279,7 +279,7 @@ mq_open (const char *name, int oflag, ...) { int i, fd, nonblock, created; long msgsize, index; - _off64_t filesize; + _off64_t filesize = 0; va_list ap; mode_t mode; int8_t *mptr; @@ -427,7 +427,7 @@ exists: /* Allocate one mq_info{} for each open */ if (!(mqinfo = (struct mq_info *) malloc (sizeof (struct mq_info)))) goto err; - mqinfo->mqi_hdr = (struct mq_hdr *) mptr; + mqinfo->mqi_hdr = mqhdr = (struct mq_hdr *) mptr; mqinfo->mqi_magic = MQI_MAGIC; mqinfo->mqi_flags = nonblock; |