ofloader: fix warning and typo
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
parent
d0ad047f81
commit
ccd6aec427
@ -310,12 +310,17 @@ int main(int argc, FAR char *argv[])
|
|||||||
{
|
{
|
||||||
FAR struct devinfo_s *devinfo;
|
FAR struct devinfo_s *devinfo;
|
||||||
FAR struct ofloader_msg *msg;
|
FAR struct ofloader_msg *msg;
|
||||||
|
struct mq_attr mqattr;
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
size_t count;
|
size_t count;
|
||||||
size_t i;
|
size_t i;
|
||||||
mqd_t mq;
|
mqd_t mq;
|
||||||
|
|
||||||
|
memset(&mqattr, 0, sizeof(struct mq_attr));
|
||||||
|
mqattr.mq_msgsize = sizeof(msg);
|
||||||
|
mqattr.mq_maxmsg = 10;
|
||||||
|
|
||||||
if (g_create_idle)
|
if (g_create_idle)
|
||||||
{
|
{
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
@ -324,7 +329,7 @@ int main(int argc, FAR char *argv[])
|
|||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
mq = mq_open(OFLOADER_QNAME, O_CREAT | O_RDWR, 0660, NULL);
|
mq = mq_open(OFLOADER_QNAME, O_CREAT | O_RDWR, 0660, &mqattr);
|
||||||
if (mq < 0)
|
if (mq < 0)
|
||||||
{
|
{
|
||||||
OFLOADER_DEBUG("mq_open error:%d\n", errno);
|
OFLOADER_DEBUG("mq_open error:%d\n", errno);
|
||||||
@ -347,7 +352,7 @@ int main(int argc, FAR char *argv[])
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (mq_receive(mq, (FAR void *)&msg, sizeof(msg), NULL) < 0)
|
if (mq_receive(mq, (FAR char *)&msg, sizeof(msg), NULL) < 0)
|
||||||
{
|
{
|
||||||
OFLOADER_DEBUG(" mq_receive error %d\n", -errno);
|
OFLOADER_DEBUG(" mq_receive error %d\n", -errno);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user