From: Martti Rannanjärvi Date: Thu, 2 Nov 2017 14:20:39 +0000 (+0200) Subject: quota: Make quota_get_result errors <= QUOTA_GET_RESULT_INTERNAL_ERROR X-Git-Tag: 2.3.0.rc1~485 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e78fe2531fd5cc3e3670a32fca6fbc238c960329;p=thirdparty%2Fdovecot%2Fcore.git quota: Make quota_get_result errors <= QUOTA_GET_RESULT_INTERNAL_ERROR Reorder the enum to make a shortcut for distinguishing errors. --- diff --git a/src/plugins/quota/quota.h b/src/plugins/quota/quota.h index 32a0118e57..fcb0dcb526 100644 --- a/src/plugins/quota/quota.h +++ b/src/plugins/quota/quota.h @@ -49,15 +49,17 @@ enum quota_alloc_result { QUOTA_ALLOC_RESULT_OVER_QUOTA_LIMIT, }; +/* Anything <= QUOTA_GET_RESULT_INTERNAL_ERROR is an error. */ enum quota_get_result { + /* Quota resource name doesn't exist */ + QUOTA_GET_RESULT_UNKNOWN_RESOURCE, + /* Internal error */ + QUOTA_GET_RESULT_INTERNAL_ERROR, + /* Quota limit exists and was returned successfully */ QUOTA_GET_RESULT_LIMITED, /* Quota is unlimited, but its value was returned */ QUOTA_GET_RESULT_UNLIMITED, - /* Quota resource name doesn't exist */ - QUOTA_GET_RESULT_UNKNOWN_RESOURCE, - /* Internal error */ - QUOTA_GET_RESULT_INTERNAL_ERROR = -1, }; const char *quota_alloc_result_errstr(enum quota_alloc_result res,