slock with DPMS and other tweaks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Localize running and failure inside readpw()

They are only needed there, so don't make them global.

authored by

Quentin Rameau and committed by
Markus Teich
03a87179 39fb855a

+4 -6
+4 -6
slock.c
··· 46 46 47 47 static Lock **locks; 48 48 static int nscreens; 49 - static Bool running = True; 50 - static Bool failure = False; 51 49 static Bool rr; 52 50 static int rrevbase; 53 51 static int rrerrbase; ··· 132 130 #endif 133 131 { 134 132 char buf[32], passwd[256], *encrypted; 135 - int num, screen; 133 + int num, screen, running, failure; 136 134 unsigned int len, color; 137 135 KeySym ksym; 138 136 XEvent ev; 139 137 static int oldc = INIT; 140 138 141 139 len = 0; 142 - running = True; 140 + running = 1; 141 + failure = 0; 143 142 144 143 /* As "slock" stands for "Simple X display locker", the DPMS settings 145 144 * had been removed and you can set it with "xset" or some other ··· 253 252 XSetWindowAttributes wa; 254 253 Cursor invisible; 255 254 256 - if (!running || dpy == NULL || screen < 0 || !(lock = malloc(sizeof(Lock)))) 255 + if (dpy == NULL || screen < 0 || !(lock = malloc(sizeof(Lock)))) 257 256 return NULL; 258 257 259 258 lock->screen = screen; ··· 376 375 377 376 /* did we manage to lock everything? */ 378 377 if (nlocks != nscreens) { 379 - running = 0; 380 378 cleanup(dpy); 381 379 return 1; 382 380 }