summaryrefslogtreecommitdiff
path: root/libdecor/src
diff options
context:
space:
mode:
Diffstat (limited to 'libdecor/src')
-rw-r--r--libdecor/src/cursor-settings.c25
-rw-r--r--libdecor/src/cursor-settings.h25
-rw-r--r--libdecor/src/libdecor.h1
-rw-r--r--libdecor/src/os-compatibility.c21
-rw-r--r--libdecor/src/plugins/cairo/libdecor-cairo.c3
-rw-r--r--libdecor/src/plugins/common/libdecor-cairo-blur.c (renamed from libdecor/src/plugins/cairo/libdecor-cairo-blur.c)0
-rw-r--r--libdecor/src/plugins/common/libdecor-cairo-blur.h (renamed from libdecor/src/plugins/cairo/libdecor-cairo-blur.h)0
-rw-r--r--libdecor/src/plugins/gtk/libdecor-gtk.c4
8 files changed, 73 insertions, 6 deletions
diff --git a/libdecor/src/cursor-settings.c b/libdecor/src/cursor-settings.c
index b94623fd6..225034cdd 100644
--- a/libdecor/src/cursor-settings.c
+++ b/libdecor/src/cursor-settings.c
@@ -1,3 +1,28 @@
+/*
+ * Copyright © 2019 Christian Rauch
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
#include "cursor-settings.h"
#include <stdlib.h>
#include <string.h>
diff --git a/libdecor/src/cursor-settings.h b/libdecor/src/cursor-settings.h
index 700bb4f30..0cc1cb6bf 100644
--- a/libdecor/src/cursor-settings.h
+++ b/libdecor/src/cursor-settings.h
@@ -1,3 +1,28 @@
+/*
+ * Copyright © 2019 Christian Rauch
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
#pragma once
#include <stdbool.h>
diff --git a/libdecor/src/libdecor.h b/libdecor/src/libdecor.h
index d3ccea181..078169771 100644
--- a/libdecor/src/libdecor.h
+++ b/libdecor/src/libdecor.h
@@ -1,6 +1,7 @@
/*
* Copyright © 2017-2018 Red Hat Inc.
* Copyright © 2018 Jonas Ådahl
+ * Copyright © 2019 Christian Rauch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
diff --git a/libdecor/src/os-compatibility.c b/libdecor/src/os-compatibility.c
index 50beb79f8..8287da0e6 100644
--- a/libdecor/src/os-compatibility.c
+++ b/libdecor/src/os-compatibility.c
@@ -29,6 +29,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#include <signal.h>
#include <string.h>
#include <stdlib.h>
@@ -86,11 +87,27 @@ static int
os_resize_anonymous_file(int fd, off_t size)
{
#ifdef HAVE_POSIX_FALLOCATE
+ sigset_t mask;
+ sigset_t old_mask;
+
+ /* posix_fallocate() might be interrupted, so we need to check
+ * for EINTR and retry in that case.
+ * However, in the presence of an alarm, the interrupt may trigger
+ * repeatedly and prevent a large posix_fallocate() to ever complete
+ * successfully, so we need to first block SIGALRM to prevent
+ * this.
+ */
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGALRM);
+ sigprocmask(SIG_BLOCK, &mask, &old_mask);
/*
- * Filesystems that do support fallocate will return EINVAL or
+ * Filesystems that do not support fallocate will return EINVAL or
* EOPNOTSUPP. In this case we need to fall back to ftruncate
*/
- errno = posix_fallocate(fd, 0, size);
+ do {
+ errno = posix_fallocate(fd, 0, size);
+ } while (errno == EINTR);
+ sigprocmask(SIG_SETMASK, &old_mask, NULL);
if (errno == 0)
return 0;
else if (errno != EINVAL && errno != EOPNOTSUPP)
diff --git a/libdecor/src/plugins/cairo/libdecor-cairo.c b/libdecor/src/plugins/cairo/libdecor-cairo.c
index 12af8aacb..0cc0ce0dd 100644
--- a/libdecor/src/plugins/cairo/libdecor-cairo.c
+++ b/libdecor/src/plugins/cairo/libdecor-cairo.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2018 Jonas Ådahl
+ * Copyright © 2019 Christian Rauch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -44,7 +45,7 @@
#include <cairo/cairo.h>
#include <pango/pangocairo.h>
-#include "libdecor-cairo-blur.h"
+#include "common/libdecor-cairo-blur.h"
static const size_t SHADOW_MARGIN = 24; /* graspable part of the border */
static const size_t TITLE_HEIGHT = 24;
diff --git a/libdecor/src/plugins/cairo/libdecor-cairo-blur.c b/libdecor/src/plugins/common/libdecor-cairo-blur.c
index 2cddc7a23..2cddc7a23 100644
--- a/libdecor/src/plugins/cairo/libdecor-cairo-blur.c
+++ b/libdecor/src/plugins/common/libdecor-cairo-blur.c
diff --git a/libdecor/src/plugins/cairo/libdecor-cairo-blur.h b/libdecor/src/plugins/common/libdecor-cairo-blur.h
index d48e9dd3d..d48e9dd3d 100644
--- a/libdecor/src/plugins/cairo/libdecor-cairo-blur.h
+++ b/libdecor/src/plugins/common/libdecor-cairo-blur.h
diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c
index a2019d5af..448fdb855 100644
--- a/libdecor/src/plugins/gtk/libdecor-gtk.c
+++ b/libdecor/src/plugins/gtk/libdecor-gtk.c
@@ -42,9 +42,7 @@
#include <cairo/cairo.h>
-/* Note for FLTK: This header file changes location, while its content stays unchanged,
- between the master and gtk_cairo_single branches */
-#include "../cairo/libdecor-cairo-blur.h"
+#include "common/libdecor-cairo-blur.h"
#include <poll.h>
#include <gtk/gtk.h>