From patchwork Wed Aug 30 14:51:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9929837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 920A5603B4 for ; Wed, 30 Aug 2017 14:51:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83E09283FF for ; Wed, 30 Aug 2017 14:51:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7895E286A9; Wed, 30 Aug 2017 14:51:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3297B286AD for ; Wed, 30 Aug 2017 14:51:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751760AbdH3Ova (ORCPT ); Wed, 30 Aug 2017 10:51:30 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37148 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbdH3Ov2 (ORCPT ); Wed, 30 Aug 2017 10:51:28 -0400 Received: by mail-wr0-f194.google.com with SMTP id k9so1567955wre.4; Wed, 30 Aug 2017 07:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=51u8VBTiPxy78cqNoQy0OX5YJ8r88FBC6CgwX1RhyNU=; b=Z3bP44EjOnPWo79lMn7lhBDxnncU7sXWKJvpZSaGt+wS5U0WKCRETW7EHtuciAVKeV +Xek7w80pRKkh3TKxqXXe7SsZHPq2oUNhf2C8aNk+71xm4wRI1NmsydMtSeG3RSMsXb+ i2YgBI2dICzSr6U2aXl6G43xTXnEcEMrh3bYR2ItWwjY3Ze4dCupqAnlapvjBwxVDXC8 sAIEJ9IJAw7BOMYY3KWKB27HzS+/swqmp2jB8FZaWLi9AdtS+pyHHub/RUOJWFYSGuwk grPnM7/tbtYVvzIRa2eyEQ7aLnWPmyQk6uGTZVEwwLqonEUwu4mNHqXcDd3pN+46BghA whtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=51u8VBTiPxy78cqNoQy0OX5YJ8r88FBC6CgwX1RhyNU=; b=BGa8yYWsXo6yOxwkLW3feoCZDivey9Xfdm9aEwj6qTWA/UQ9bGCSTeF054EY5uj4pS arNYQgQTbqJIiXIzc+0VAQWcYb955UUoh0ju+FkByoGVovOw5Bck5yKTzhWfzZThQjVf tQ5aFToEluW1cXcA/QQcn4BsjiwX0VDEQhnWW7kK2bAr+iaDz10d7fRhqMV/1FpRk+Sr aV5t3lzQpjBep6mbdnDPaIRgpBiiH2el9cYjIvuJr7cKALKEfivK6nTVeldCYE4ebRLZ 3yRLMnEbPTPG2vvY8kQ4MMpf+oLR4bZrcmEFGxdRKid2fBGTQJcVWHkVaJARwpIMi5CG H8DQ== X-Gm-Message-State: AHYfb5i9Gc7pGiqilDAVb5rGo4V+Cc5ypZzjLIAY7qKzcCv6W/mk6izd jHjvuUyZxosPuA== X-Received: by 10.223.155.213 with SMTP id e21mr1260725wrc.65.1504104686920; Wed, 30 Aug 2017 07:51:26 -0700 (PDT) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id f42sm2606306wrf.27.2017.08.30.07.51.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 07:51:26 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Josef Bacik , "Darrick J . Wong" , Christoph Hellwig , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH v2 05/14] fsx: fix compile warnings Date: Wed, 30 Aug 2017 17:51:37 +0300 Message-Id: <1504104706-11965-6-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504104706-11965-1-git-send-email-amir73il@gmail.com> References: <1504104706-11965-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Amir Goldstein --- ltp/fsx.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index 1502905..e789aad 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -211,9 +211,9 @@ prt(const char *fmt, ...) va_start(args, fmt); vsnprintf(buffer, BUF_SIZE, fmt, args); va_end(args); - fprintf(stdout, buffer); + fputs(buffer, stdout); if (fsxlogf) - fprintf(fsxlogf, buffer); + fputs(buffer, fsxlogf); } void @@ -569,14 +569,20 @@ check_trunc_hack(void) { struct stat statbuf; - ftruncate(fd, (off_t)0); - ftruncate(fd, (off_t)100000); + if (ftruncate(fd, (off_t)0)) + goto ftruncate_err; + if (ftruncate(fd, (off_t)100000)) + goto ftruncate_err; fstat(fd, &statbuf); if (statbuf.st_size != (off_t)100000) { prt("no extend on truncate! not posix!\n"); exit(130); } - ftruncate(fd, 0); + if (ftruncate(fd, 0)) { +ftruncate_err: + prterr("check_trunc_hack: ftruncate"); + exit(131); + } } void @@ -1742,7 +1748,10 @@ __test_fallocate(int mode, const char *mode_str) mode_str); } else { ret = 1; - ftruncate(fd, 0); + if (ftruncate(fd, 0)) { + warn("main: ftruncate"); + exit(132); + } } } return ret;