aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk10
-rw-r--r--slock.c7
2 files changed, 8 insertions, 9 deletions
diff --git a/config.mk b/config.mk
index 442b4cf..cfa5369 100644
--- a/config.mk
+++ b/config.mk
@@ -14,17 +14,15 @@ INCS = -I. -I/usr/include -I${X11INC}
14LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext 14LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext
15 15
16# flags 16# flags
17CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H 17CPPFLAGS = -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H
18LDFLAGS = ${LIBS} 18CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
19#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H 19LDFLAGS = -s ${LIBS}
20#LDFLAGS = -g ${LIBS}
21 20
22# On *BSD remove -DHAVE_SHADOW_H from CFLAGS and add -DHAVE_BSD_AUTH 21# On *BSD remove -DHAVE_SHADOW_H from CPPFLAGS and add -DHAVE_BSD_AUTH
23# On OpenBSD and Darwin remove -lcrypt from LIBS 22# On OpenBSD and Darwin remove -lcrypt from LIBS
24 23
25# compiler and linker 24# compiler and linker
26CC = cc 25CC = cc
27LD = ${CC}
28 26
29# Install mode. On BSD systems MODE=2755 and GROUP=auth 27# Install mode. On BSD systems MODE=2755 and GROUP=auth
30# On others MODE=4755 and GROUP=root 28# On others MODE=4755 and GROUP=root
diff --git a/slock.c b/slock.c
index d576c0b..6f2e8af 100644
--- a/slock.c
+++ b/slock.c
@@ -22,7 +22,7 @@
22#include <bsd_auth.h> 22#include <bsd_auth.h>
23#endif 23#endif
24 24
25void 25static void
26die(const char *errstr, ...) { 26die(const char *errstr, ...) {
27 va_list ap; 27 va_list ap;
28 28
@@ -33,7 +33,7 @@ die(const char *errstr, ...) {
33} 33}
34 34
35#ifndef HAVE_BSD_AUTH 35#ifndef HAVE_BSD_AUTH
36const char * 36static const char *
37get_password() { /* only run as root */ 37get_password() { /* only run as root */
38 const char *rval; 38 const char *rval;
39 struct passwd *pw; 39 struct passwd *pw;
@@ -132,11 +132,12 @@ main(int argc, char **argv) {
132 if(ev.type == KeyPress) { 132 if(ev.type == KeyPress) {
133 buf[0] = 0; 133 buf[0] = 0;
134 num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0); 134 num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0);
135 if(IsKeypadKey(ksym)) 135 if(IsKeypadKey(ksym)) {
136 if(ksym == XK_KP_Enter) 136 if(ksym == XK_KP_Enter)
137 ksym = XK_Return; 137 ksym = XK_Return;
138 else if(ksym >= XK_KP_0 && ksym <= XK_KP_9) 138 else if(ksym >= XK_KP_0 && ksym <= XK_KP_9)
139 ksym = (ksym - XK_KP_0) + XK_0; 139 ksym = (ksym - XK_KP_0) + XK_0;
140 }
140 if(IsFunctionKey(ksym) || IsKeypadKey(ksym) 141 if(IsFunctionKey(ksym) || IsKeypadKey(ksym)
141 || IsMiscFunctionKey(ksym) || IsPFKey(ksym) 142 || IsMiscFunctionKey(ksym) || IsPFKey(ksym)
142 || IsPrivateKeypadKey(ksym)) 143 || IsPrivateKeypadKey(ksym))