Re: [PATCH 18/20] Btrfs-progs: fix magic return value in cmds-balance.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/05/2013 04:21 PM, Stefan Behrens wrote:
On Thu, 05 Sep 2013 15:44:11 +0800, Wang Shilong wrote:
[..]
@@ -297,9 +305,10 @@ static int do_balance(const char *path, struct
btrfs_ioctl_balance_args *args,
          DIR *dirstream = NULL;

          fd = open_file_or_dir(path, &dirstream);
+       e = errno;
          if (fd < 0) {
                  fprintf(stderr, "ERROR: can't access to '%s'\n", path);
-               return 12;
+               return e;
Since I didn't understand whether you rejected or acknowledged Ilya's
My answer: acknowledged.

Will send a V2 later, just wait more comments.

Thanks,
Wang
comments, if you don't do so, please change the above line to "return
-e" like it is everywhere else: errno is returned as a negative value, 0
means no error, a positive value means the function failed but the
return value cannot be interpreted as an errno.
--
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


--
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




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux