From patchwork Thu Apr 4 16:14:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13618040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4C02CD1292 for ; Thu, 4 Apr 2024 16:14:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4740F6B00A2; Thu, 4 Apr 2024 12:14:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 422086B00A3; Thu, 4 Apr 2024 12:14:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29BBC6B00A4; Thu, 4 Apr 2024 12:14:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0BA986B00A2 for ; Thu, 4 Apr 2024 12:14:22 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 96B5AC0523 for ; Thu, 4 Apr 2024 16:14:21 +0000 (UTC) X-FDA: 81972346722.01.4493767 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf06.hostedemail.com (Postfix) with ESMTP id E6B2C180016 for ; Thu, 4 Apr 2024 16:14:19 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=fRx2C0Ai; spf=pass (imf06.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712247260; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=m56r0GSROYrACguTsmxOrhJF5RdeE/vmtoJTbm7JVvQ=; b=SD6hvLKaWwrf59YvA8Y8H7IGTtjH124E9wYEgrHKqaVS/EDimQcKACyOdLzsCUAFC7/hM0 TgamSStOPomJuZh/SMPXtoJ7COQhCkglOE7DaNutkSHr9nkW1OAeLATytWCgbsUXFDw9OC js/UJCRuENP54seVW+8qRqQJuSBeanU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=fRx2C0Ai; spf=pass (imf06.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712247260; a=rsa-sha256; cv=none; b=wKcIj61D8U783ICFjZgKJNuNiDFi+GuG+G3FrHLNZnnE77Uj9t2/KjSrk81LcHu+bZ8+8W GTOzBjUVxvwwFT2maO9Qli64IZ3RidRz3aQvEr3uZfzY0G64+hiHDtnnmNKF4AdPsLUy/2 T9zS3cKGOoRxHaFDVYSv1vWp5ZqZhxs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712247258; bh=ldtvjkAh4uiGxCheNFBwI4fa4kaJRENVGkoL+ZPIS0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRx2C0AiLQ4G1u6VFtu1nRt8ktODQ2HPoOEC4eASfbnsv3kNtEnb3RqER3Y2wbRY9 d/pJoQRl2pj7+q7DT0patY2f1zEPrCtrwOUGfyEg+1Y9GoFWQMUusXNax/Kl1k9DY1 73JunOQKqEIxh0+00nwpZp9kupfykapjNm13AahJ2r9U2cuRX5xsRw9syYMPjG5lR1 JnvrI/7rMjOBLXXhKhsNJ9b2Be3kKxApdA/+kWDhXAzANyGnmiGUzjGpQ0M/2GT64W SpEU9pSg90tT9ET8Bb0UgJvlZbj/k0v0OPetMnblBZWVFmWXQfOqKLD2YM0CZcB08/ VqJE/TPfcDIEA== Received: from localhost.localdomain (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B8A7B378212B; Thu, 4 Apr 2024 16:14:14 +0000 (UTC) From: Muhammad Usama Anjum To: Eric Biederman , Kees Cook , Shuah Khan , Muhammad Usama Anjum , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel@collabora.com Subject: [PATCH 2/2] selftests: exec: Use new ksft_exit_fail_perror() helper Date: Thu, 4 Apr 2024 21:14:33 +0500 Message-Id: <20240404161433.114497-3-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240404161433.114497-1-usama.anjum@collabora.com> References: <20240404161433.114497-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: E6B2C180016 X-Rspam-User: X-Stat-Signature: kwqyo7f58junf4p586rbamf8xeygfrix X-Rspamd-Server: rspam01 X-HE-Tag: 1712247259-467999 X-HE-Meta: U2FsdGVkX18esvnoN1PpCEPPRe2xWTBJ5DEE+flR5cZXyJjRpAzAif7oc/x+WLd9f1Hs0ifTmXk92SDQ/xhBONI4gtT/zXJAtM548qSDvx7yxGnd4MRKQ1jEklHY5vu1EP7PSyaaMY9PrBHwWdzq5lQY9RB+5d8SWrrVEz+WYOrLH8GLJwy3dTFZJAcneqjQaUU4vLmc5N6ADWvcX5keO7ryxMe0Na2yRcspqrlNpueScEXQUfLYCidE/yalks01kl7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linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use ksft_exit_fail_perror() to print the value of errno and its string form. This is the first user of the ksft_exit_fail_perror() and proves the usefulness of this API. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/exec/recursion-depth.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/exec/recursion-depth.c b/tools/testing/selftests/exec/recursion-depth.c index b2f37d86a5f62..438c8ff2fd260 100644 --- a/tools/testing/selftests/exec/recursion-depth.c +++ b/tools/testing/selftests/exec/recursion-depth.c @@ -37,25 +37,25 @@ int main(void) ksft_test_result_skip("error: unshare, errno %d\n", errno); ksft_finished(); } - ksft_exit_fail_msg("error: unshare, errno %d\n", errno); + ksft_exit_fail_perror("error: unshare"); } if (mount(NULL, "/", NULL, MS_PRIVATE | MS_REC, NULL) == -1) - ksft_exit_fail_msg("error: mount '/', errno %d\n", errno); + ksft_exit_fail_perror("error: mount '/'"); /* Require "exec" filesystem. */ if (mount(NULL, "/tmp", "ramfs", 0, NULL) == -1) - ksft_exit_fail_msg("error: mount ramfs, errno %d\n", errno); + ksft_exit_fail_perror("error: mount ramfs"); #define FILENAME "/tmp/1" fd = creat(FILENAME, 0700); if (fd == -1) - ksft_exit_fail_msg("error: creat, errno %d\n", errno); + ksft_exit_fail_perror("error: creat"); #define S "#!" FILENAME "\n" if (write(fd, S, strlen(S)) != strlen(S)) - ksft_exit_fail_msg("error: write, errno %d\n", errno); + ksft_exit_fail_perror("error: write"); close(fd);