@@ -1026,7 +1026,6 @@ static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
int ret;
int fd;
int i;
- int e;
DIR *dirstream = NULL;
unsigned unit_mode;
char *sortmode = NULL;
@@ -1114,9 +1113,8 @@ static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
while (1) {
sk->nr_items = 1;
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
- e = errno;
if (ret < 0) {
- error("cannot perform the search: %s", strerror(e));
+ error("cannot perform the search: %m");
return 1;
}
if (sk->nr_items == 0)
The variable @e is only utilized to record the errno from ioctl() call, and is only for the error message. We can go with "%m" to replace the usage of variable @e, and remove the variable shadowing, as later we will declare a local variable @e with a different type. Signed-off-by: Qu Wenruo <wqu@suse.com> --- cmds/inspect.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)