From patchwork Wed May 4 19:43:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Massey X-Patchwork-Id: 9018041 Return-Path: X-Original-To: patchwork-linux-btrfs@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 4FDEDBF29F for ; Wed, 4 May 2016 19:43:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AF42203C1 for ; Wed, 4 May 2016 19:43:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22125203C0 for ; Wed, 4 May 2016 19:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752249AbcEDTnk (ORCPT ); Wed, 4 May 2016 15:43:40 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:36588 "EHLO mail-qk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbcEDTnj (ORCPT ); Wed, 4 May 2016 15:43:39 -0400 Received: by mail-qk0-f170.google.com with SMTP id x7so31811441qkd.3 for ; Wed, 04 May 2016 12:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7CPo+GXK0yLb93ab+gO8/7KpQ9MiOmvJpIiYeb+CkoU=; b=NEn/Ws5wTw5hrLXPBhJ+g/cJp/UmF4HXQYMlcHrodz57Mn1+Fd6J3ju+fZoYP2mcyH KWVjHCdJW+8XFTS52RxkThd3DqrVWv4vbqvBDDCpQQ2uNe8vEdOhxzD7TZ/NIIy/wJ47 HnO9jtXNZaamWYv9oIx06fe1ZJqPZnHbN/vJOnXzcgk3OpKrZJUV+3O5seXrMcX61J2e VpxP8lcw9xWsQRjZoPiCdAEyx3Z25Aind/50Ewm+JUrJeORM4WVw9tyYYurXAdMPU8l+ iN7ZOdcvkDMdkToy+VnPgaj6zY8TwPuNjzGMMZPI4rXf9WsMilMvLTDqySnbS8wLfuq1 /Qnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7CPo+GXK0yLb93ab+gO8/7KpQ9MiOmvJpIiYeb+CkoU=; b=JS5v6vlJC9oYzv1+Qp1N0GTY56Kg3Kb42InsDpxcUsFbcF5ZgfNjUD0gVpfq9S6zeC XkCV41jI6vNMzdzBp/qoi0FgfAatKo3GSi4+50tq/D75SZQ79ZRZnFx71+DCxsfIxqWf 8ZoOET5ykgluWJU0mKxkpDJXzPdXAuAotR6r8Y4GvGehx/Qq4rkfPwPtsmSYc7K9rvvj Eq1V4eqRdepJe0mQ0o6eVblO/dXMNoNGdY9Ok3A/1OySgVUaymu7Tf64Ap3yFPsASntz 87rd1u9D2v8vQpuMLqJi5gy04QLbN5n4Sq0wOcUH9x7fQxUr/ZXN/h9v8WtGQXt+8vDm rdXA== X-Gm-Message-State: AOPr4FWQhe/gUZgKSAEKRGGnrKpdFoM3oqTz7dWpvTljatvdBF5O8Nbr2Ub7OUXD/lKZZw== X-Received: by 10.55.145.6 with SMTP id t6mr10647697qkd.206.1462391018110; Wed, 04 May 2016 12:43:38 -0700 (PDT) Received: from liara.sep.net (18262c93.cst.lightpath.net. [24.38.44.147]) by smtp.gmail.com with ESMTPSA id 77sm1922233qgn.29.2016.05.04.12.43.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 May 2016 12:43:37 -0700 (PDT) From: Noah Massey To: David Sterba , linux-btrfs@vger.kernel.org Cc: Noah Massey Subject: [PATCH] btrfs-progs: Adjust timing of safety delay countdown Date: Wed, 4 May 2016 15:43:26 -0400 Message-Id: <1462391006-4057-1-git-send-email-noah.massey@gmail.com> X-Mailer: git-send-email 2.8.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 When printing the countdown in the safety delay, the number should correspond to the number of seconds remaining to wait at the time the delay is printed. In other words, there should be a one second sleep after printing '1'. Signed-off-by: Noah Massey --- cmds-balance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-balance.c b/cmds-balance.c index 5f05f60..8f3bf5b 100644 --- a/cmds-balance.c +++ b/cmds-balance.c @@ -445,9 +445,9 @@ static int do_balance(const char *path, struct btrfs_ioctl_balance_args *args, printf("\twarning. The operation will start in %d seconds.\n", delay); printf("\tUse Ctrl-C to stop it.\n"); while (delay) { - sleep(1); printf("%2d", delay--); fflush(stdout); + sleep(1); } printf("\nStarting balance without any filters.\n"); }