From: Timo Sirainen Date: Sun, 4 Apr 2010 21:00:53 +0000 (+0300) Subject: doveadm quota get: Fixed error handling. X-Git-Tag: 2.0.beta5~244 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18792f1110ecd1fca5306f3be96fcbe887f6dbcc;p=thirdparty%2Fdovecot%2Fcore.git doveadm quota get: Fixed error handling. --HG-- branch : HEAD --- diff --git a/src/plugins/quota/doveadm-quota.c b/src/plugins/quota/doveadm-quota.c index e31ec5e6d0..356863d204 100644 --- a/src/plugins/quota/doveadm-quota.c +++ b/src/plugins/quota/doveadm-quota.c @@ -23,9 +23,15 @@ static void cmd_quota_get_root(struct mail_user *user, struct quota_root *root) res = quota_root_get_resources(root); for (; *res != NULL; res++) { ret = quota_get_resource(root, "", *res, &value, &limit); - printf("%s %llu/%llu", *res, - (unsigned long long)value, - (unsigned long long)limit); + printf("%s ", *res); + if (ret > 0) { + printf("%llu/%llu", + (unsigned long long)value, + (unsigned long long)limit); + } else if (ret == 0) + printf("none"); + else + printf("error"); if (res[1] != NULL) printf(", "); }