]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - tools/testing/selftests/ipc/msgque.c
selftests/ipc: Fix msgque compiler warnings
[mirror_ubuntu-bionic-kernel.git] / tools / testing / selftests / ipc / msgque.c
index ee9382bdfadc8755b17f87c9e37437a28688e376..c5587844fbb8c6e2e5254ea050f6167c834186ad 100644 (file)
@@ -1,9 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0
+#define _GNU_SOURCE
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#include <linux/msg.h>
+#include <sys/msg.h>
 #include <fcntl.h>
 
 #include "../kselftest.h"
@@ -73,7 +74,7 @@ int restore_queue(struct msgque_data *msgque)
        return 0;
 
 destroy:
-       if (msgctl(id, IPC_RMID, 0))
+       if (msgctl(id, IPC_RMID, NULL))
                printf("Failed to destroy queue: %d\n", -errno);
        return ret;
 }
@@ -120,7 +121,7 @@ int check_and_destroy_queue(struct msgque_data *msgque)
 
        ret = 0;
 err:
-       if (msgctl(msgque->msq_id, IPC_RMID, 0)) {
+       if (msgctl(msgque->msq_id, IPC_RMID, NULL)) {
                printf("Failed to destroy queue: %d\n", -errno);
                return -errno;
        }
@@ -129,7 +130,7 @@ err:
 
 int dump_queue(struct msgque_data *msgque)
 {
-       struct msqid64_ds ds;
+       struct msqid_ds ds;
        int kern_id;
        int i, ret;
 
@@ -246,7 +247,7 @@ int main(int argc, char **argv)
        return ksft_exit_pass();
 
 err_destroy:
-       if (msgctl(msgque.msq_id, IPC_RMID, 0)) {
+       if (msgctl(msgque.msq_id, IPC_RMID, NULL)) {
                printf("Failed to destroy queue: %d\n", -errno);
                return ksft_exit_fail();
        }