while (1) {
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
- if (ret < 0) {
- error("cannot perform the search: %s",
- strerror(errno));
- return ret;
- }
+ if (ret < 0)
+ return -errno;
+
/* the ioctl returns the number of item it found in nr_items */
if (sk->nr_items == 0)
break;
if (!opt_tmp)
return -ENOMEM;
- while ((p = strtok(opt_tmp, ",")) != NULL) {
+ p = strtok(opt_tmp, ",");
+ while (p) {
flag = 0;
ptr_argv = all_sort_items;
}
btrfs_qgroup_setup_comparer(comps, what_to_sort, order);
}
- free(opt_tmp);
- opt_tmp = NULL;
+ p = strtok(NULL, ",");
}
out: