aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c2
-rw-r--r--sway/commands/bar.c2
-rw-r--r--sway/commands/output/background.c2
-rw-r--r--sway/main.c6
-rw-r--r--sway/server.c4
-rw-r--r--sway/tree/workspace.c2
6 files changed, 12 insertions, 6 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 359856cc..e72b8916 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE 500
+#define _POSIX_C_SOURCE 200809
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
diff --git a/sway/commands/bar.c b/sway/commands/bar.c
index f6a70c17..f760888e 100644
--- a/sway/commands/bar.c
+++ b/sway/commands/bar.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE 500
+#define _POSIX_C_SOURCE 200809
#include <string.h>
#include <strings.h>
#include <wlr/util/log.h>
diff --git a/sway/commands/output/background.c b/sway/commands/output/background.c
index 74894812..ddad679d 100644
--- a/sway/commands/output/background.c
+++ b/sway/commands/output/background.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE 500
+#define _POSIX_C_SOURCE 200809
#include <libgen.h>
#include <strings.h>
#include <unistd.h>
diff --git a/sway/main.c b/sway/main.c
index 7ed10c86..2f05dc38 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -366,13 +366,15 @@ int main(int argc, char **argv) {
return 1;
}
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
if (getuid() != geteuid() || getgid() != getegid()) {
+#ifdef __linux__
// Retain capabilities after setuid()
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0)) {
wlr_log(WLR_ERROR, "Cannot keep caps after setuid()");
exit(EXIT_FAILURE);
}
+#endif
suid = true;
}
#endif
@@ -382,7 +384,7 @@ int main(int argc, char **argv) {
detect_proprietary();
detect_raspi();
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
drop_permissions(suid);
#endif
// handle SIGTERM signals
diff --git a/sway/server.c b/sway/server.c
index 8b5bc93c..749365cb 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -140,6 +140,10 @@ bool server_init(struct sway_server *server) {
void server_fini(struct sway_server *server) {
// TODO: free sway-specific resources
+#ifdef HAVE_XWAYLAND
+ wlr_xwayland_destroy(server->xwayland.wlr_xwayland);
+#endif
+ wl_display_destroy_clients(server->wl_display);
wl_display_destroy(server->wl_display);
list_free(server->dirty_containers);
list_free(server->transactions);
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 60256336..1957d94f 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE 500
+#define _POSIX_C_SOURCE 200809
#include <ctype.h>
#include <limits.h>
#include <stdbool.h>