diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2013-09-18 16:27:35 +0800 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-10-16 08:22:26 -0400 |
commit | 39813fb7ac3e622b25f27dcd78e98242e121011e (patch) | |
tree | 88a5099b7c8b89bbab9f1a3c09e0308d69a920b8 /chunk-recover.c | |
parent | 77801d34d02e04ea4d5344415015a2ce84e0b653 (diff) |
Btrfs-progs: move ask_user() to utils.c
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'chunk-recover.c')
-rw-r--r-- | chunk-recover.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/chunk-recover.c b/chunk-recover.c index 9af4887c..e44ca72b 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -1307,24 +1307,6 @@ fail_close_fd: return ret; } -/* - * This reads a line from the stdin and only returns non-zero if the - * first whitespace delimited token is a case insensitive match with yes - * or y. - */ -static int ask_user(char *question) -{ - char buf[30] = {0,}; - char *saveptr = NULL; - char *answer; - - printf("%s [y/N]: ", question); - - return fgets(buf, sizeof(buf) - 1, stdin) && - (answer = strtok_r(buf, " \t\n\r", &saveptr)) && - (!strcasecmp(answer, "yes") || !strcasecmp(answer, "y")); -} - static int btrfs_get_device_extents(u64 chunk_object, struct list_head *orphan_devexts, struct list_head *ret_list) |