From patchwork Mon Sep 21 03:47:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaolei X-Patchwork-Id: 7227541 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA706BEEC1 for ; Mon, 21 Sep 2015 03:48:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFAA120821 for ; Mon, 21 Sep 2015 03:48:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB2A120843 for ; Mon, 21 Sep 2015 03:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755927AbbIUDsr (ORCPT ); Sun, 20 Sep 2015 23:48:47 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:16856 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755924AbbIUDsq (ORCPT ); Sun, 20 Sep 2015 23:48:46 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100921395" Received: from bogon (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 21 Sep 2015 11:51:31 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t8L3mRmS009079 for ; Mon, 21 Sep 2015 11:48:27 +0800 Received: from localhost.localdomain (10.167.226.114) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.181.6; Mon, 21 Sep 2015 11:48:43 +0800 From: Zhaolei To: CC: Zhao Lei Subject: [PATCH] fstests: Fix wrong ret value in log Date: Mon, 21 Sep 2015 11:47:05 +0800 Message-ID: <2747ef92dbd3d3b64a7b7e397155af9b57630312.1442807209.git.zhaolei@cn.fujitsu.com> X-Mailer: git-send-email 1.8.5.1 MIME-Version: 1.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zhao Lei Current code always output "truncfile returned 0" because $? was modified by previous command. This patch fixed above bug. Signed-off-by: Zhao Lei --- tests/generic/014 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/generic/014 b/tests/generic/014 index 7961961..a775f8b 100755 --- a/tests/generic/014 +++ b/tests/generic/014 @@ -61,10 +61,12 @@ echo "brevity is wit..." echo "------" echo "test 1" echo "------" -if ! src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1 +src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1 +ret=$? +if [ "$ret" -ne 0 ] then out=`cat $tmp.out` - echo "truncfile returned $? : \"$out\"" + echo "truncfile returned $ret : \"$out\"" else echo "OK" fi