btrfs-progs: unified error handling in print_replace_status
authorZhao Lei <zhaolei@cn.fujitsu.com>
Tue, 25 Aug 2015 14:50:08 +0000 (22:50 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 31 Aug 2015 17:25:13 +0000 (19:25 +0200)
commit96fbc6a146ba2b7356112d99ede54cf362797990
treef965308fcef43effa1ec22aca1edc61e1a4b1cd8
parent2d46558b30f5e130085212de7e3a22e2780e8d2a
btrfs-progs: unified error handling in print_replace_status

Current code of print_replace_status() mixed stdout and stderr in error
case, output a error string to stderr without "\n", then output "\n" to
stdout to end the line.

This patch fixed above problem by using unified error handle way for 3
type of errors in print_replace_status().

Also include some small logic cleanup.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-replace.c