Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3061679yba; Mon, 8 Apr 2019 10:14:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHHOvGdvIJjHtMTeIz9xw2dEuOHozl5N7imZKyzkqNs0ifGzIxb3Uu98bYtDOKyaUaFbnm X-Received: by 2002:a17:902:7794:: with SMTP id o20mr30859705pll.189.1554743683463; Mon, 08 Apr 2019 10:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554743683; cv=none; d=google.com; s=arc-20160816; b=Xj/DSB9N7QUjny2DPxZAjjns6e/CUGtSiHbPY+liXIC6IZ1RQPbA86amshudKZKylS xUr9ly+wl4wJwX8DFfUIniBZ8zuVGIK68LY16+vJt7y19W+4alTFsRY8FA2PvrvMy4mT vgXZnt31LXZiZ7JOIjfe8RsOc+EwUTPHdk1sm01Nu0nOhzZaEOWzipS8gd9FNCOo3Qoj ZCrCThG0KT4GG2A9Qz5QY3obEzfvbXvGBZk2wdhROWGKtX60Ph5jmxb2tUUTMjGcOjKo PZGU0MisVWIHv8gey5RIyF1WT70LGwHM+WBk64mqZINLIAs0cb50+/J+hhc5nITzGD8Z AzvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=zFQBbigOTEog9L119nzi8yUiDvvH6RzigfyLgG6e7ew=; b=leSdJNJW5fdF8Cj52WmYOFQsdGyCD7eahZcWngPWbCGM1LVjHW0oN/myEpN6Wez79F CcdmXSDkkbxWOKfc4jnXE7vxdST1ZP9gW2dH8zU+qEZlvfMi2cUx0iBuGzM65UX1ZTMl seb8smurn4ZmiqwcaJmfdY+5D6YhHPLiMjXtbBWPli/MVVtLcelPsW76OpJEJd1uyBcG kBBhsXgL0u0jYLKiT5pbDU6Ii8r6Gxchu/YuSu6s1kVoFv5sPmnGU1W8dEzwYS52aqek Sd3ETWAmT9EizzFfo6fI6XK/hWlb6VHaogRrYUlOTV+IgNUp3+3IkiuqNhwNFYsO74V4 NOVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=A+grWCdx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si9313427pfi.165.2019.04.08.10.14.27; Mon, 08 Apr 2019 10:14:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=A+grWCdx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729098AbfDHRNs (ORCPT + 99 others); Mon, 8 Apr 2019 13:13:48 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45201 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728738AbfDHRNr (ORCPT ); Mon, 8 Apr 2019 13:13:47 -0400 Received: by mail-pg1-f193.google.com with SMTP id y3so7665044pgk.12 for ; Mon, 08 Apr 2019 10:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=zFQBbigOTEog9L119nzi8yUiDvvH6RzigfyLgG6e7ew=; b=A+grWCdx8z6DrlFCINwSLbdf9vaJ7EjSoWTqNtWAYNMIyN+2qOt3uI4yxc/tXEXyg6 dQwK6bkrKK1/uoT39PDU+fb7IQYs+t4wnjMD/xTfE5X7xmalBdq0nDqcZfuUb54j9FsH J/jFy9SleTnf3cpSJiLA7pg20hVWQx5J9sI3M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=zFQBbigOTEog9L119nzi8yUiDvvH6RzigfyLgG6e7ew=; b=kN55/x4IIw1PonYKYFtSh75/qqbpBx933EHGvGdZkYDJWEDt9d7Hohm3MsqsoSjb+C bIVjmMkRvT3vLgmyI16wVZoEfzfiEg85+kiNQa8eVWOyFrhgoS07o2zUWGxAwXvGoWnq j+IjQPzVpakYb7sDFnmkdqV+C0V0h/334q0klKjbnio43vQX10gxhPT90W8zycYCOYlo V8bUIuIHyYOzV/6ZV8Fxg/eykzMpZnH2DoWz9xvM65dP/CXwQmgz56H7z/9kD/vVCWWs 5pBHrQWNz1QiWVBqWBAEHLpmBImSl6TiSHZygz6HbYSh7GELS0WOrGnXfu/thC4x16Ic PdKA== X-Gm-Message-State: APjAAAXda0q+HhtCs85DOzkCht7hoAZH3KM9WD/AEf74cS0FIXFGt5jb z6GNE+iV2APxCBSulgn93tVSdMFjt1U= X-Received: by 2002:a62:1795:: with SMTP id 143mr31584409pfx.104.1554743626910; Mon, 08 Apr 2019 10:13:46 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id v43sm17080239pgn.57.2019.04.08.10.13.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Apr 2019 10:13:46 -0700 (PDT) Date: Mon, 8 Apr 2019 10:13:44 -0700 From: Kees Cook To: Shuah Khan Cc: Stanislav Kinsbursky , Manfred Spraul , Davidlohr Bueso , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/ipc: Fix msgque compiler warnings Message-ID: <20190408171344.GA22803@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This fixes the various compiler warnings when building the msgque selftest. The primary change is using sys/msg.h instead of linux/msg.h directly to gain the API declarations. Fixes: 3a665531a3b7 ("selftests: IPC message queue copy feature test") Signed-off-by: Kees Cook --- tools/testing/selftests/ipc/msgque.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c index dac927e82336..4c156aeab6b8 100644 --- a/tools/testing/selftests/ipc/msgque.c +++ b/tools/testing/selftests/ipc/msgque.c @@ -1,9 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 +#define _GNU_SOURCE #include #include #include #include -#include +#include #include #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 @@ int check_and_destroy_queue(struct msgque_data *msgque) int dump_queue(struct msgque_data *msgque) { - struct msqid64_ds ds; + struct msqid_ds ds; int kern_id; int i, ret; @@ -245,7 +246,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(); } -- 2.17.1 -- Kees Cook