diff options
| -rw-r--r-- | config.mk | 10 | ||||
| -rw-r--r-- | slock.c | 7 |
2 files changed, 8 insertions, 9 deletions
| @@ -14,17 +14,15 @@ INCS = -I. -I/usr/include -I${X11INC} | |||
| 14 | LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext | 14 | LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext |
| 15 | 15 | ||
| 16 | # flags | 16 | # flags |
| 17 | CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H | 17 | CPPFLAGS = -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H |
| 18 | LDFLAGS = ${LIBS} | 18 | CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} |
| 19 | #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H | 19 | LDFLAGS = -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 |
| 26 | CC = cc | 25 | CC = cc |
| 27 | LD = ${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 |
| @@ -22,7 +22,7 @@ | |||
| 22 | #include <bsd_auth.h> | 22 | #include <bsd_auth.h> |
| 23 | #endif | 23 | #endif |
| 24 | 24 | ||
| 25 | void | 25 | static void |
| 26 | die(const char *errstr, ...) { | 26 | die(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 |
| 36 | const char * | 36 | static const char * |
| 37 | get_password() { /* only run as root */ | 37 | get_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)) |
