]> sourceware.org Git - newlib-cygwin.git/commitdiff
* posix_ipc.cc (mq_open): Avoid compiler warning. Initialize mqhdr
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 15 Feb 2007 17:49:25 +0000 (17:49 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 15 Feb 2007 17:49:25 +0000 (17:49 +0000)
before using it in file exists case.
* include/mqueue.h (mqd_t): Make non-pointer type.

winsup/cygwin/ChangeLog
winsup/cygwin/include/mqueue.h
winsup/cygwin/posix_ipc.cc

index 4e29c989d339719676c326d2fba7955d9dc90c91..af9fc2617192c23dfcb9320828b9ab94b59e7e1b 100644 (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>
 
        * posix_ipc.cc (ipc_mutex_init): Create global object name.
index 804a809199bdd2a79d0d9090aeecfaf9b0335b24..59c32dbe4d18779673b4c1abe0cda9531389c2d0 100644 (file)
@@ -18,7 +18,7 @@
 
 __BEGIN_DECLS
 
-typedef void *mqd_t;
+typedef intptr_t mqd_t;
 
 struct mq_attr {
   long  mq_flags;      /* Message queue flags */
index a0a38d2fcad5a8af27ff1f9f1c6be2b9ef9a5edd..c286b248373e05235ad34dabdcb60c72ef1c1a93 100644 (file)
@@ -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;
 
This page took 0.033908 seconds and 5 git commands to generate.