btrfs: Proper error when output of 'btrfs qgroup show' command cannot be parsed.

sscanf doesn't set errno in these cases so it's wrong to call perror
here.

This fixes commit 2b7f7810ed.
This commit is contained in:
Richard W.M. Jones
2015-02-03 08:53:43 +00:00
parent 725d95422b
commit 8fd4231051

View File

@@ -1275,7 +1275,7 @@ do_btrfs_qgroup_show (const char *path)
if (sscanf (line, "%" SCNu64 "/%" SCNu64 " %" SCNu64 " %" SCNu64,
&dummy1, &dummy2, &this->btrfsqgroup_rfer,
&this->btrfsqgroup_excl) != 4) {
reply_with_perror ("sscanf");
reply_with_error ("cannot parse output of qgroup show command: %s", line);
goto error;
}
p = strchr(line, ' ');