]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Use quota->debug instead of getenv()ing it every time.
authorTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 18:37:53 +0000 (21:37 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 18:37:53 +0000 (21:37 +0300)
--HG--
branch : HEAD

src/plugins/quota/quota-dict.c
src/plugins/quota/quota-fs.c

index 0fd339ab03afe20910cdea0b09c951ac472eac9e..ce54cf736d42896ed5dd6f5fc6ff21599e75571c 100644 (file)
@@ -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);
        }
index 35c73a835809cfd72c2974aa6ff7e54895a1c1bf..acdb45d5976d1fd631380d373d2c91fe213a73e4 100644 (file)
@@ -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");
        }