summaryrefslogtreecommitdiff
path: root/cmds-send.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2012-10-25 17:27:57 +0200
committerDavid Sterba <dsterba@suse.cz>2013-01-17 18:27:54 +0100
commit043437d8e1609874018a28996d1878847e57bd55 (patch)
tree7505a0f554847180fd37589215c7ccaac353999a /cmds-send.c
parente1a97972ac2b52f8bcb85682b0376346a35e3cf5 (diff)
downloadbtrfs-progs-043437d8e1609874018a28996d1878847e57bd55.tar.gz
btrfs-progs-043437d8e1609874018a28996d1878847e57bd55.tar.bz2
btrfs-progs-043437d8e1609874018a28996d1878847e57bd55.zip
btrfs-progs: do not send stream into a terminal
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-send.c')
-rw-r--r--cmds-send.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds-send.c b/cmds-send.c
index 59522c35..29a7dd34 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -429,6 +429,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':