From patchwork Thu Oct 25 15:27:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 1645381 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 31632DF2AB for ; Thu, 25 Oct 2012 15:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755240Ab2JYP2S (ORCPT ); Thu, 25 Oct 2012 11:28:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49831 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116Ab2JYP2R (ORCPT ); Thu, 25 Oct 2012 11:28:17 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 503BAA2FD6; Thu, 25 Oct 2012 17:28:16 +0200 (CEST) Received: by ds.suse.cz (Postfix, from userid 10065) id 70B0F74AC9; Thu, 25 Oct 2012 17:28:15 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: chris.mason@fusionio.com, David Sterba Subject: [PATCH] btrfs-progs: do not send stream into a terminal Date: Thu, 25 Oct 2012 17:27:57 +0200 Message-Id: <1351178877-10188-1-git-send-email-dsterba@suse.cz> X-Mailer: git-send-email 1.7.6.233.gd79bc Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: David Sterba --- cmds-send.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 9b47e70..e37f5d2 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -427,6 +427,11 @@ int cmd_send_start(int argc, char **argv) memset(&send, 0, sizeof(send)); send.dump_fd = fileno(stdout); + if (isatty(send.dump_fd)) { + fprintf(stderr, "ERROR: not dumping send stream into a terminal, redirect it into a file\n"); + return 1; + } + while ((c = getopt(argc, argv, "vf:i:p:")) != -1) { switch (c) { case 'v':