changeset 8030:7fdb5f222d95 HEAD

Use quota->debug instead of getenv()ing it every time.
author Timo Sirainen <tss@iki.fi>
date Sun, 20 Jul 2008 21:37:53 +0300
parents 796307638449
children be8550f51b02
files src/plugins/quota/quota-dict.c src/plugins/quota/quota-fs.c
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 	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);
 	}
--- 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 @@
 
 	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 @@
 	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 @@
 				*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 @@
 		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 @@
 		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");
 	}