dovecot-2.0: doveadm quota get: Fixed error handling.
    dovecot at dovecot.org 
    dovecot at dovecot.org
       
    Mon Apr  5 00:00:56 EEST 2010
    
    
  
details:   http://hg.dovecot.org/dovecot-2.0/rev/4f23c349da0d
changeset: 11030:4f23c349da0d
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 05 00:00:53 2010 +0300
description:
doveadm quota get: Fixed error handling.
diffstat:
 src/plugins/quota/doveadm-quota.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diffs (22 lines):
diff -r 3504ce6159f3 -r 4f23c349da0d src/plugins/quota/doveadm-quota.c
--- a/src/plugins/quota/doveadm-quota.c	Sun Apr 04 23:42:38 2010 +0300
+++ b/src/plugins/quota/doveadm-quota.c	Mon Apr 05 00:00:53 2010 +0300
@@ -23,9 +23,15 @@
 	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(", ");
 	}
    
    
More information about the dovecot-cvs
mailing list