btrfs-progs: cmd quota: switch to common error message wrapper
authorDavid Sterba <dsterba@suse.com>
Mon, 11 Jan 2016 10:01:47 +0000 (11:01 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 12 Jan 2016 14:02:51 +0000 (15:02 +0100)
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-quota.c

index efbc3ef..34b8dac 100644 (file)
@@ -53,8 +53,7 @@ static int quota_ctl(int cmd, int argc, char **argv)
        e = errno;
        close_file_or_dir(fd, dirstream);
        if (ret < 0) {
-               fprintf(stderr, "ERROR: quota command failed: %s\n",
-                       strerror(e));
+               error("quota command failed: %s", strerror(e));
                return 1;
        }
        return 0;
@@ -129,7 +128,7 @@ static int cmd_quota_rescan(int argc, char **argv)
        }
 
        if (ioctlnum != BTRFS_IOC_QUOTA_RESCAN && wait_for_completion) {
-               fprintf(stderr, "ERROR: -w cannot be used with -s\n");
+               error("switch -w cannot be used with -s");
                return 1;
        }
 
@@ -154,8 +153,7 @@ static int cmd_quota_rescan(int argc, char **argv)
 
        if (ioctlnum == BTRFS_IOC_QUOTA_RESCAN) {
                if (ret < 0) {
-                       fprintf(stderr, "ERROR: quota rescan failed: "
-                               "%s\n", strerror(e));
+                       error("quota rescan failed: %s", strerror(e));
                        return 1;
                }  else {
                        printf("quota rescan started\n");