diff options
Diffstat (limited to 'slock.c')
-rw-r--r-- | slock.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -46,8 +46,6 @@ typedef struct { | |||
46 | 46 | ||
47 | static Lock **locks; | 47 | static Lock **locks; |
48 | static int nscreens; | 48 | static int nscreens; |
49 | static Bool running = True; | ||
50 | static Bool failure = False; | ||
51 | static Bool rr; | 49 | static Bool rr; |
52 | static int rrevbase; | 50 | static int rrevbase; |
53 | static int rrerrbase; | 51 | static int rrerrbase; |
@@ -132,14 +130,15 @@ readpw(Display *dpy, const char *pws) | |||
132 | #endif | 130 | #endif |
133 | { | 131 | { |
134 | char buf[32], passwd[256], *encrypted; | 132 | char buf[32], passwd[256], *encrypted; |
135 | int num, screen; | 133 | int num, screen, running, failure; |
136 | unsigned int len, color; | 134 | unsigned int len, color; |
137 | KeySym ksym; | 135 | KeySym ksym; |
138 | XEvent ev; | 136 | XEvent ev; |
139 | static int oldc = INIT; | 137 | static int oldc = INIT; |
140 | 138 | ||
141 | len = 0; | 139 | len = 0; |
142 | running = True; | 140 | running = 1; |
141 | failure = 0; | ||
143 | 142 | ||
144 | /* As "slock" stands for "Simple X display locker", the DPMS settings | 143 | /* As "slock" stands for "Simple X display locker", the DPMS settings |
145 | * had been removed and you can set it with "xset" or some other | 144 | * had been removed and you can set it with "xset" or some other |
@@ -253,7 +252,7 @@ lockscreen(Display *dpy, int screen) | |||
253 | XSetWindowAttributes wa; | 252 | XSetWindowAttributes wa; |
254 | Cursor invisible; | 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 | return NULL; | 256 | return NULL; |
258 | 257 | ||
259 | lock->screen = screen; | 258 | lock->screen = screen; |
@@ -376,7 +375,6 @@ main(int argc, char **argv) { | |||
376 | 375 | ||
377 | /* did we manage to lock everything? */ | 376 | /* did we manage to lock everything? */ |
378 | if (nlocks != nscreens) { | 377 | if (nlocks != nscreens) { |
379 | running = 0; | ||
380 | cleanup(dpy); | 378 | cleanup(dpy); |
381 | return 1; | 379 | return 1; |
382 | } | 380 | } |