From patchwork Tue Sep 14 17:08:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Lezhepekov X-Patchwork-Id: 1528087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=oO8iVTJ6; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H88wd3z1mz9sRK for ; Wed, 15 Sep 2021 03:09:53 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7CBA83C2308 for ; Tue, 14 Sep 2021 19:09:51 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 181DA3CA4D3 for ; Tue, 14 Sep 2021 19:09:05 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 9BAB1200751 for ; Tue, 14 Sep 2021 19:09:04 +0200 (CEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 4890F22137; Tue, 14 Sep 2021 17:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631639344; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bypL7Q+CYNEzUVkj+The4FxAjTD2JfsxzJlWxS0sscA=; b=oO8iVTJ6LlWI8dN8tFvs3UwYrYlF/wPoXzHRe5lIPIiPLZiEV2pCWjFQP3E6RRnV73LXMO rErHBqaYk+3VicG+6T7OYmMHM+VpYUsm2udolmEh9jbZnubNco0lbbwK99MVaS8yY1pI8S idhNcxJAwhg5T9VqL4BgWHDPY4Y7Q7w= Received: from localhost.suse.de (blezhepekov.udp.ovpn2.nue.suse.de [10.163.45.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 153D0A3B9C; Tue, 14 Sep 2021 17:09:04 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 14 Sep 2021 20:08:51 +0300 Message-Id: <20210914170851.22931-6-bogdan.lezhepekov@suse.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210914170851.22931-1-bogdan.lezhepekov@suse.com> References: <20210914170851.22931-1-bogdan.lezhepekov@suse.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH v1 6/6] rt:pi-tests:testpi-6: return exit code X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Bogdan Lezhepekov via ltp From: Bogdan Lezhepekov Reply-To: Bogdan Lezhepekov Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Bogdan Lezhepekov --- testcases/realtime/func/pi-tests/testpi-6.c | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/testcases/realtime/func/pi-tests/testpi-6.c b/testcases/realtime/func/pi-tests/testpi-6.c index 637d38355..bc271f242 100644 --- a/testcases/realtime/func/pi-tests/testpi-6.c +++ b/testcases/realtime/func/pi-tests/testpi-6.c @@ -69,27 +69,35 @@ int do_test(int argc, char **argv) { pthread_mutexattr_t mutexattr; int retc, robust; + unsigned int err; - if (pthread_mutexattr_init(&mutexattr) != 0) + if (pthread_mutexattr_init(&mutexattr) != 0) { printf("Failed to init mutexattr\n"); + err++; + } if (pthread_mutexattr_setrobust(&mutexattr, - PTHREAD_MUTEX_ROBUST) != 0) + PTHREAD_MUTEX_ROBUST) != 0) { printf("Can't set robust mutex\n"); - - if (pthread_mutexattr_getrobust(&mutexattr, &robust) != 0) + err++; + } + + if (pthread_mutexattr_getrobust(&mutexattr, &robust) != 0) { printf("Can't get mutexattr protocol\n"); - else + err++; + } else printf("robust in mutexattr is %d\n", robust); retc = pthread_mutex_init(&child_mutex, &mutexattr); - if (retc != 0) + if (retc != 0) { printf("Failed to init mutex: %d\n", retc); + err++; + } create_other_thread(child_thread, NULL); join_threads(); - return 0; + return err > 0 ? 1 : 0; } #include "test-skeleton.c"