dovecot-1.2: Use quota->debug instead of getenv()ing it every time.
dovecot at dovecot.org
dovecot at dovecot.org
Sun Jul 20 21:37:57 EEST 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/7fdb5f222d95
changeset: 8030:7fdb5f222d95
user: Timo Sirainen <tss at iki.fi>
date: Sun Jul 20 21:37:53 2008 +0300
description:
Use quota->debug instead of getenv()ing it every time.
diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
src/plugins/quota/quota-dict.c | 2 +-
src/plugins/quota/quota-fs.c | 12 ++++++------
diffs (68 lines):
diff -r 796307638449 -r 7fdb5f222d95 src/plugins/quota/quota-dict.c
--- a/src/plugins/quota/quota-dict.c Sun Jul 20 21:36:13 2008 +0300
+++ b/src/plugins/quota/quota-dict.c Sun Jul 20 21:37:53 2008 +0300
@@ -50,7 +50,7 @@ static int dict_quota_init(struct quota_
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 -r 796307638449 -r 7fdb5f222d95 src/plugins/quota/quota-fs.c
--- a/src/plugins/quota/quota-fs.c Sun Jul 20 21:36:13 2008 +0300
+++ b/src/plugins/quota/quota-fs.c Sun Jul 20 21:37:53 2008 +0300
@@ -246,7 +246,7 @@ static void fs_quota_storage_added(struc
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_roo
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_roo
*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_roo
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 qu
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");
}
More information about the dovecot-cvs
mailing list