commit 79a9eacaeded9aea74e710e7caa8ccf572ecf30c
parent b5724ab6d2af48302e62672158c51b98ebe6aad1
Author: Raymond Li <hi@raymond.li>
Date: Sat, 18 Jul 2020 21:59:04 -0400
Merge everything from upstream except PR i3#280
Diffstat:
6 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/.clang-format b/.clang-format
@@ -8,3 +8,4 @@ IndentWidth: 4
PointerBindsToType: false
ColumnLimit: 0
SpaceBeforeParens: ControlStatements
+SortIncludes: false
diff --git a/.travis.yml b/.travis.yml
@@ -7,11 +7,7 @@ language: c
compiler:
- gcc
- clang
-addons:
- apt:
- packages:
- - clang-format-3.5
script:
- - clang-format-3.5 -i *.[ch] && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false)
- docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile .
+ - docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'clang-format-9 -i *.[ch] && git diff --exit-code || (echo "Code was not formatted using clang-format!"; false)'
- docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j V=1 CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"'
diff --git a/configure.ac b/configure.ac
@@ -66,6 +66,7 @@ AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_STRNLEN
AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3lock requires])])
+AC_CHECK_FUNCS([explicit_bzero])
# Checks for libraries.
diff --git a/i3lock.c b/i3lock.c
@@ -18,7 +18,6 @@
#include <stdlib.h>
#include <pwd.h>
#include <sys/types.h>
-#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <stdbool.h>
@@ -29,7 +28,7 @@
#include <err.h>
#include <errno.h>
#include <assert.h>
-#ifdef __OpenBSD__
+#ifdef HAVE_EXPLICIT_BZERO
#include <bsd_auth.h>
#else
#include <security/pam_appl.h>
@@ -45,7 +44,7 @@
#include <xkbcommon/xkbcommon-x11.h>
#include <cairo.h>
#include <cairo/cairo-xcb.h>
-#ifdef __OpenBSD__
+#ifdef HAVE_EXPLICIT_BZERO
#include <strings.h> /* explicit_bzero(3) */
#endif
#include <xcb/xcb_aux.h>
@@ -906,7 +905,7 @@ static void process_xkb_event(xcb_generic_event_t *gevent) {
* and also redraw the image, if any.
*
*/
-void handle_screen_resize(void) {
+static void handle_screen_resize(void) {
xcb_get_geometry_cookie_t geomc;
xcb_get_geometry_reply_t *geom;
geomc = xcb_get_geometry(conn, screen->root);
diff --git a/i3lock.h b/i3lock.h
@@ -8,10 +8,11 @@
* This is important because xautolock (for example) closes stdout/stderr by
* default, so just printing something to stdout will lead to the data ending
* up on the X11 socket (!). */
-#define DEBUG(fmt, ...) \
- do { \
- if (debug_mode) \
- printf("[i3lock-debug] " fmt, ##__VA_ARGS__); \
+ #define DEBUG(fmt, ...) \
+ do { \
+ if (debug_mode) { \
+ fprintf(stderr, "[i3lock-debug] " fmt, ##__VA_ARGS__); \
+ } \
} while (0)
#endif
diff --git a/travis/Dockerfile b/travis/Dockerfile
@@ -11,7 +11,7 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry
# (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now.
# Install mk-build-deps (for installing the i3 build dependencies),
-# clang and clang-format-3.8 (for checking formatting and building with clang),
+# clang and clang-format-9 (for checking formatting and building with clang),
# lintian (for checking spelling errors),
# test suite dependencies (for running tests)
RUN apt-get update && \
@@ -19,7 +19,7 @@ RUN apt-get update && \
build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \
libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \
libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \
- libxkbcommon-x11-dev && \
+ libxkbcommon-x11-dev clang-format-9 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src