Bug 806407 Fix type in struct passed into msgsnd f=jesup
authorEthan Hugg <ethanhugg@gmail.com>
Fri, 09 Nov 2012 08:47:00 -0800
changeset 112999 891f2dc392f01037dcb48fc50d5d74d4a9c0e709
parent 112998 3052145ed25c9c0a7b8b58921a025937e5f35cfb
child 113000 4d4abb8e14190cd96cb06f63679c8281e514ca25
push id23847
push userphilringnalda@gmail.com
push dateTue, 13 Nov 2012 05:07:25 +0000
treeherdermozilla-central@1b0226622e94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs806407
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 806407 Fix type in struct passed into msgsnd f=jesup
media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c
media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.h
--- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c
+++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.c
@@ -34,16 +34,19 @@
  */
 #include "cpr.h"
 #include "cpr_stdlib.h"
 #include <cpr_stdio.h>
 #include <errno.h>
 #include <sys/msg.h>
 #include <sys/ipc.h>
 #include "plat_api.h"
+#include "CSFLog.h"
+
+static const char *logTag = "cpr_linux_ipc";
 
 #define STATIC static
 
 /* @def The Message Queue depth */
 #define OS_MSGTQL 31
 
 /*
  * Internal CPR API
@@ -235,59 +238,59 @@ cprCreateMessageQueue (const char *name,
     }
 
     msgq->name = name ? name : unnamed_string;
 
     /*
      * Find a unique key
      */
     key = ftok("/proc/self", key_id++);
-    printf("key = %x\n", key);
+    CSFLogDebug(logTag, "key = %x\n", key);
 
     if (key == -1) {
         CPR_ERROR("%s: Key generation failed: %d\n", fname, errno);
         cpr_free(msgq);
         return NULL;
     }
 
     /*
      * Set creation flag so that OS will create the message queue
      */
     msgq->queueId = msgget(key, (IPC_EXCL | IPC_CREAT | 0666));
     if (msgq->queueId == -1) {
         if (errno == EEXIST) {
-            printf("Q exists so first remove it and then create again\n");
+            CSFLogDebug(logTag, "Q exists so first remove it and then create again\n");
                 /* Remove message queue */
             msgq->queueId = msgget(key, (IPC_CREAT | 0666));
             if (msgctl(msgq->queueId, IPC_RMID, &buf) == -1) {
 
                 CPR_ERROR("%s: Destruction failed: %s: %d\n", fname,
                           msgq->name, errno);
 
                 return NULL;
             }
             msgq->queueId = msgget(key, (IPC_CREAT | 0666));
         }
     } else {
-        printf("there was no preexisting q..\n");
+        CSFLogDebug(logTag, "there was no preexisting q..\n");
 
     }
 
 
 
     if (msgq->queueId == -1) {
         CPR_ERROR("%s: Creation failed: %s: %d\n", fname, name, errno);
         if (errno == EEXIST) {
 
         }
 
         cpr_free(msgq);
         return NULL;
     }
-    printf("create message q with id=%x\n", msgq->queueId);
+    CSFLogDebug(logTag, "create message q with id=%x\n", msgq->queueId);
 
     /* flush the q before ?? */
 
     /*
      * Create mutex for extended (overflow) queue
      */
     if (pthread_mutex_init(&msgq->mutex, NULL) != 0) {
         CPR_ERROR("%s: Failed to create msg queue (%s) mutex: %d\n",
@@ -342,17 +345,17 @@ cprCreateMessageQueue (const char *name,
  */
 cprRC_t
 cprDestroyMessageQueue (cprMsgQueue_t msgQueue)
 {
     static const char fname[] = "cprDestroyMessageQueue";
     cpr_msg_queue_t *msgq;
     void *msg;
     struct msqid_ds buf;
-    printf("Destroy message Q called..\n");
+    CSFLogDebug(logTag, "Destroy message Q called..\n");
 
 
     msgq = (cpr_msg_queue_t *) msgQueue;
     if (msgq == NULL) {
         /* Bad application! */
         CPR_ERROR("%s: Invalid input\n", fname);
         errno = EINVAL;
         return CPR_FAILURE;
--- a/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.h
+++ b/media/webrtc/signaling/src/sipcc/cpr/linux/cpr_linux_ipc.h
@@ -15,17 +15,17 @@
 #define CPR_MAX_MSG_SIZE  8192
 
 /* Our CNU msgtype */
 #define CPR_IPC_MSG 1
 
 
 /* Message buffer layout */
 struct msgbuffer {
-    int32_t mtype;    /* Message type */
+    long    mtype;    /* Message type */
     void   *msgPtr;   /* Ptr to msg */
     void   *usrPtr;   /* Ptr to user data */
 };
 
 /* For gathering statistics regarding message queues */
 typedef struct {
     char name[16];
     uint16_t maxCount;