From: Timo Sirainen Date: Sun, 20 Jul 2008 18:37:53 +0000 (+0300) Subject: Use quota->debug instead of getenv()ing it every time. X-Git-Tag: 1.2.alpha1~131 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6029d57f528b755be84a7d0326ad1c52063d9ca7;p=thirdparty%2Fdovecot%2Fcore.git Use quota->debug instead of getenv()ing it every time. --HG-- branch : HEAD --- diff --git a/src/plugins/quota/quota-dict.c b/src/plugins/quota/quota-dict.c index 0fd339ab03..ce54cf736d 100644 --- a/src/plugins/quota/quota-dict.c +++ b/src/plugins/quota/quota-dict.c @@ -50,7 +50,7 @@ static int dict_quota_init(struct quota_root *_root, const char *args) if (*username == '\0') username = getenv("USER"); - if (getenv("DEBUG") != NULL) { + if (_root->quota->debug) { i_info("dict quota: user=%s, uri=%s, enforcing=%d", username, args, _root->no_enforcing); } diff --git a/src/plugins/quota/quota-fs.c b/src/plugins/quota/quota-fs.c index 35c73a8358..acdb45d597 100644 --- a/src/plugins/quota/quota-fs.c +++ b/src/plugins/quota/quota-fs.c @@ -246,7 +246,7 @@ static void fs_quota_storage_added(struct quota *quota, dir = mail_storage_get_mailbox_path(storage, "", &is_file); mount = fs_quota_mountpoint_get(dir); - if (getenv("DEBUG") != NULL) { + if (quota->debug) { i_info("fs quota add storage dir = %s", dir); i_info("fs quota block device = %s", mount->device_path); i_info("fs quota mount point = %s", mount->mount_path); @@ -304,7 +304,7 @@ static int do_rquota(struct fs_quota_root *root, bool bytes, host = t_strdup_until(mount->device_path, path); path++; - if (getenv("DEBUG") != NULL) { + if (root->root.quota->debug) { i_info("quota-fs: host=%s, path=%s, uid=%s", host, path, dec2str(root->uid)); } @@ -360,7 +360,7 @@ static int do_rquota(struct fs_quota_root *root, bool bytes, *limit_r = rq->rq_fsoftlimit; } } - if (getenv("DEBUG") != NULL) { + if (root->root.quota->debug) { i_info("quota-fs: uid=%s, value=%llu, " "limit=%llu, active=%d", dec2str(root->uid), (unsigned long long)*value_r, @@ -369,7 +369,7 @@ static int do_rquota(struct fs_quota_root *root, bool bytes, return 1; } case Q_NOQUOTA: - if (getenv("DEBUG") != NULL) { + if (root->root.quota->debug) { i_info("quota-fs: uid=%s, limit=unlimited", dec2str(root->uid)); } @@ -603,14 +603,14 @@ static bool fs_quota_match_box(struct quota_root *_root, struct mailbox *box) return FALSE; } if (stat(root->storage_mount_path, &rst) < 0) { - if (getenv("DEBUG") != NULL) { + if (_root->quota->debug) { i_error("stat(%s) failed: %m", root->storage_mount_path); } return FALSE; } match = CMP_DEV_T(mst.st_dev, rst.st_dev); - if (getenv("DEBUG") != NULL) { + if (_root->quota->debug) { i_info("box=%s mount=%s match=%s", mailbox_path, root->storage_mount_path, match ? "yes" : "no"); }