summaryrefslogtreecommitdiff
path: root/libpager/pager-attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpager/pager-attr.c')
-rw-r--r--libpager/pager-attr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpager/pager-attr.c b/libpager/pager-attr.c
index 7fae4d74..762bb971 100644
--- a/libpager/pager-attr.c
+++ b/libpager/pager-attr.c
@@ -32,6 +32,17 @@ pager_change_attributes (struct pager *p,
mutex_lock (&p->interlock);
+ /* If there's nothing to do we might be able to return. However,
+ if the user asked us to wait, and there are pending changes,
+ then we have to do the work anyway because we must follow the
+ pending change. */
+ if (p->may_cache == may_cache && p->copy_strategy == copy_strategy
+ && ! (p->attribute_requests && wait))
+ {
+ mutex_unlock (&p->interlock);
+ return;
+ }
+
p->may_cache = may_cache;
p->copy_strategy = copy_strategy;