From 69291882c6cb420a2d2c5b9bffce9078c2e37606 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Fri, 20 Aug 2021 13:51:05 +0200 Subject: [PATCH] swaylock: fix build --- ...g-fix-mismatched-allocation-function.patch | 31 +++++++++++++++++++ recipes-support/swaylock/swaylock_git.bb | 4 +++ 2 files changed, 35 insertions(+) create mode 100644 recipes-support/swaylock/files/0001-load_config-fix-mismatched-allocation-function.patch diff --git a/recipes-support/swaylock/files/0001-load_config-fix-mismatched-allocation-function.patch b/recipes-support/swaylock/files/0001-load_config-fix-mismatched-allocation-function.patch new file mode 100644 index 0000000..61fce4a --- /dev/null +++ b/recipes-support/swaylock/files/0001-load_config-fix-mismatched-allocation-function.patch @@ -0,0 +1,31 @@ +From 3e861934074148dc803e70508ad99dfbd0d14765 Mon Sep 17 00:00:00 2001 +From: Markus Volk +Date: Fri, 20 Aug 2021 13:42:57 +0200 +Subject: [PATCH] load_config: fix mismatched allocation function + +| In function 'load_config', +| inlined from 'main' at ../git/main.c:1138:23: +| ../git/main.c:1060:25: error: 'free' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc] +| 1060 | free(config); + +Signed-off-by: Markus Volk +--- + main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/main.c b/main.c +index c65d68a..7921770 100644 +--- a/main.c ++++ b/main.c +@@ -1057,7 +1057,7 @@ static int load_config(char *path, struct swaylock_state *state, + char *flag = malloc(nread + 3); + if (flag == NULL) { + free(line); +- free(config); ++ fclose(config); + swaylock_log(LOG_ERROR, "Failed to allocate memory"); + return 0; + } +-- +2.25.1 + diff --git a/recipes-support/swaylock/swaylock_git.bb b/recipes-support/swaylock/swaylock_git.bb index 843f193..73dead1 100644 --- a/recipes-support/swaylock/swaylock_git.bb +++ b/recipes-support/swaylock/swaylock_git.bb @@ -18,6 +18,7 @@ DEPENDS = " \ SRC_URI = " \ git://github.com/swaywm/swaylock.git;protocol=https \ + file://0001-load_config-fix-mismatched-allocation-function.patch \ " S = "${WORKDIR}/git" @@ -33,6 +34,9 @@ PACKAGECONFIG ?= " \ pam \ " +# Reproducibility issue. Fix me! +CFLAGS:append = " -Wno-error=date-time" + inherit meson pkgconfig features_check EXTRA_OEMESON += "--buildtype release"