On Fri, Sep 13, 2013 at 07:32:22PM +0800, Anand Jain wrote:
> +static int get_df(int fd, struct btrfs_ioctl_space_args **sargs_ret)
> +{
This function returns full error codes, that's ok,
> @@ -77,89 +98,79 @@ static int cmd_df(int argc, char **argv)
> ret = ioctl(fd, BTRFS_IOC_SPACE_INFO, sargs);
> e = errno;
> if (ret) {
> - fprintf(stderr, "ERROR: couldn't get space info on '%s' - %s\n",
> - path, strerror(e));
> - goto out;
> + fprintf(stderr, "ERROR: couldn't get space info - %s\n",
> + strerror(e));
> + free(sargs);
> + return ret;
cmd_df should return the 0-1 normalized value after the cleanup that
Wang Shilong has done. You can leave the common exit block (ie. goto +
free/return as before) and use return !!ret.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html