]> git.lizzy.rs Git - plan9front.git/commitdiff
screenlock: have keyboard activity reset blank timeout
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 3 Dec 2017 05:41:41 +0000 (06:41 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 3 Dec 2017 05:41:41 +0000 (06:41 +0100)
sys/src/cmd/screenlock.c

index cbf4b9b8f1471603491be8ac8d600a43a8681446..b010a0c173858f6a67c949c6036055e84a9f024f 100644 (file)
@@ -24,7 +24,7 @@ readline(char *buf, int nbuf)
        int i;
 
        i = 0;
-       while(i < nbuf-1)
+       while(i < nbuf-1){
                if(read(0, &c, 1) != 1 || c == '\04' || c == '\177'){
                        i = 0;
                        break;
@@ -36,6 +36,8 @@ readline(char *buf, int nbuf)
                        i = 0;
                else
                        buf[i++] = c;
+               blank = time(0);
+       }
        buf[i] = '\0';
 }
 
@@ -62,8 +64,6 @@ checkpassword(void)
                        break;
 
                auth_freeAI(ai);
-               blank = time(0);
-
                border(screen, screen->r, 8, display->black, ZP);
                flushimage(display, 1);
        }