Fix error checking on msgctl() 01/157401/2
authorJaroslaw Pelczar <j.pelczar@samsung.com>
Tue, 24 Oct 2017 09:34:05 +0000 (11:34 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Tue, 24 Oct 2017 10:43:01 +0000 (12:43 +0200)
Change-Id: I53fcdb05c3567e12b42a2ad7a11536e875f972cf
Signed-off-by: Jaroslaw Pelczar <j.pelczar@samsung.com>
osal/OsaQueue.c

index c1b5c16..ec9cc1f 100644 (file)
@@ -449,7 +449,11 @@ int OsaQueueSetinfo(unsigned int uiQid, void* pvBuf) {
 
        data_t = (struct QueueInfo*)pvBuf;
 
-       msgctl((int)uiQid, IPC_STAT, &buf);
+       if(msgctl((int)uiQid, IPC_STAT, &buf) < 0) {
+               perror("In OsaQueueGetinfo() : msgctl: msgctl failed");
+               return ((int)errno);
+       }
+
        buf.msg_qbytes = data_t->maxlen;
 
        if (msgctl((int)uiQid, IPC_SET, &buf) < 0) {