Subject: Re: How is screenblank supposed to work?
To: Ignatios Souvatzis <is@beverly.kleinbus.org>
From: Dave Huang <khym@bga.com>
List: current-users
Date: 01/04/2001 22:18:15
On Thu, 4 Jan 2001, Dave Huang wrote:
> output would unblank the screen?) Would the solution be to not check the
> mtime of framebuffer devices, but do check the atime? I'll give that a
> try and see if it does the right thing :)
Okay, that does seem to work... (as long as something is actively
reading ttyE0... if I do a "sleep 1000" and wait for the screen to
blank, typing doesn't wake it up until the sleep is done, or I ^C the
sleep... but that's good enough for me :)
Index: screenblank.c
===================================================================
RCS file: /cvsroot/basesrc/usr.sbin/screenblank/screenblank.c,v
retrieving revision 1.10
diff -u -r1.10 screenblank.c
--- screenblank.c 1999/06/06 03:35:36 1.10
+++ screenblank.c 2001/01/05 04:11:58
@@ -226,16 +226,14 @@
change = 0;
for (dsp = ds_list.lh_first; dsp != NULL;
dsp = dsp->ds_link.le_next) {
- /* Don't check framebuffers. */
- if (dsp->ds_isfb)
- continue;
if (stat(dsp->ds_path, &st) < 0)
err(1, "stat: %s", dsp->ds_path);
if (st.st_atime > dsp->ds_atime) {
change = 1;
dsp->ds_atime = st.st_atime;
}
- if (st.st_mtime > dsp->ds_mtime) {
+ /* Don't check a framebuffer's mtime. */
+ if (!dsp->ds_isfb && (st.st_mtime > dsp->ds_mtime)) {
change = 1;
dsp->ds_mtime = st.st_mtime;
}