Changeset 3687413 for variable.c


Ignore:
Timestamp:
May 16, 2010, 1:15:23 AM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
f034ac0
Parents:
7ba9e0de
git-author:
David Benjamin <davidben@mit.edu> (05/14/10 18:12:21)
git-committer:
David Benjamin <davidben@mit.edu> (05/16/10 01:15:23)
Message:
Only enable pseudologin timer when we use it

The feature defaults to off, and I imagine most people don't actually
use it. In that case, we shouldn't bother waking up every 2 minutes to
support it.

(owl_zephyr_buddycheck_timer was moved to zephyr.c so it'd get a
prototype. Also, it's zephyr-specific.)

Signed-off-by: David Benjamin <davidben@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    r4d9e4254 r3687413  
    428428int owl_variable_pseudologins_set(owl_variable *v, const void *newval)
    429429{
     430  static owl_timer *timer = NULL;
    430431  if (newval) {
    431432    if (*(const int*)newval == 1) {
    432433      owl_function_zephyr_buddy_check(0);
     434      if (timer == NULL) {
     435        timer = owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL, NULL);
     436      }
     437    } else {
     438      if (timer != NULL) {
     439        owl_select_remove_timer(timer);
     440        timer = NULL;
     441      }
    433442    }
    434443  }
Note: See TracChangeset for help on using the changeset viewer.