commit 1c6e3bba12887eb116f03ff72477cb1c0494cfc5 from: Benjamin Stürz date: Thu Jul 25 12:40:28 2024 UTC slock: fix compilation on Linux commit - 3c2618948ed7e2d9482424bfa110ca14a3420ef8 commit + 1c6e3bba12887eb116f03ff72477cb1c0494cfc5 blob - 620b41937d24c48796a0c6a4ef14b188cd41a952 blob + e74ce3c022e6dd4e7bb289685f2e5ca36ef7a1ba --- slock/config.h +++ slock/config.h @@ -1,6 +1,11 @@ /* user and group to drop privileges to */ static const char *user = "nobody"; + +#ifdef __linux__ +static const char *group = "nobody"; +#else static const char *group = "nogroup"; +#endif static const char *colorname[NUMCOLS] = { [INIT] = "black", /* after initialization */ blob - 7128e4a90889b606e8f538e19f35fba71006e16e blob + c6757ed8a677dfa035922bdd76ef88a1225e4ff3 --- slock/slock.c +++ slock/slock.c @@ -1,13 +1,18 @@ /* See LICENSE file for license details. */ #ifdef __FreeBSD__ # define __BSD_VISIBLE 1 +# define HAVE_BSD_AUTH 1 #endif -#define _XOPEN_SOURCE 500 +#ifdef __linux__ +# define HAVE_SHADOW_H 1 +#endif + #if HAVE_SHADOW_H -#include +# include #endif +#include #include #include #include @@ -25,8 +30,8 @@ #include #if HAVE_BSD_AUTH -#include -#include +# include +# include #endif /*POSIX threading for auto-timeout*/ @@ -59,7 +64,7 @@ struct xrandr { #include "config.h" -static void +static noreturn void die(const char *errstr, ...) { va_list ap;