diff --git a/code/application/source/sf_app/code/source/commMng/sf_message_queue.c b/code/application/source/sf_app/code/source/commMng/sf_message_queue.c index 1620000be..00c8a3ac6 100644 --- a/code/application/source/sf_app/code/source/commMng/sf_message_queue.c +++ b/code/application/source/sf_app/code/source/commMng/sf_message_queue.c @@ -66,14 +66,29 @@ static SINT32 message_queue_create(SF_CHAR *pathname,SINT32 *pMsgQueueId) printf("[%s:%d] ftok error\n", __FUNCTION__, __LINE__); return SF_FAILURE; } - if ((*pMsgQueueId = msgget(key, IPC_CREAT | 0660)) == -1) + if ((*pMsgQueueId = msgget(key, IPC_CREAT | 0666)) == -1) { printf("[%s:%d] MsgQueueId = %#x msgget failed errno.%02d is: %s\n", __FUNCTION__, __LINE__,*pMsgQueueId, errno, strerror(errno)); //MLOGI("MsgQueueId = %#x\n"); //MLOGI("msgget failed errno.%02d is: %s\n"); return SF_FAILURE; } - printf("[%s:%d] MsgQueueId = %#x\n", __FUNCTION__, __LINE__,*pMsgQueueId); + + struct msqid_ds buf; + if (msgctl(*pMsgQueueId, IPC_STAT, &buf) == -1) { + perror("msgctl IPC_STAT"); + return SF_FAILURE; + } + //printf("[%s:%d] key:%d buf.msg_qbytes:%d\n", __FUNCTION__, __LINE__, key, buf.msg_qbytes); + + buf.msg_qbytes = 32768; + + if (msgctl(*pMsgQueueId, IPC_SET, &buf) == -1) { + perror("msgctl IPC_SET"); + return SF_FAILURE; + } + + printf("[%s:%d] MsgQueueId = %d\n", __FUNCTION__, __LINE__,*pMsgQueueId); //MLOGI("\n"); return SF_SUCCESS; }