diff options
Diffstat (limited to 'backend/session')
-rw-r--r-- | backend/session/direct-freebsd.c | 23 | ||||
-rw-r--r-- | backend/session/direct-ipc.c | 10 | ||||
-rw-r--r-- | backend/session/direct.c | 21 | ||||
-rw-r--r-- | backend/session/logind.c | 19 | ||||
-rw-r--r-- | backend/session/session.c | 11 |
5 files changed, 44 insertions, 40 deletions
diff --git a/backend/session/direct-freebsd.c b/backend/session/direct-freebsd.c index c0621416..6e23bf1b 100644 --- a/backend/session/direct-freebsd.c +++ b/backend/session/direct-freebsd.c @@ -1,21 +1,22 @@ +#include <dev/evdev/input.h> #include <errno.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdbool.h> -#include <unistd.h> +#include <fcntl.h> #include <signal.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/consio.h> #include <sys/ioctl.h> +#include <sys/kbio.h> #include <sys/stat.h> -#include <termios.h> -#include <fcntl.h> #include <sys/types.h> -#include <dev/evdev/input.h> -#include <sys/kbio.h> -#include <sys/consio.h> +#include <termios.h> +#include <unistd.h> #include <wayland-server.h> #include <wlr/backend/session/interface.h> #include <wlr/util/log.h> #include "backend/session/direct-ipc.h" +#include "util/signal.h" const struct session_impl session_direct; @@ -95,12 +96,12 @@ static int vt_handler(int signo, void *data) { if (session->base.active) { session->base.active = false; - wl_signal_emit(&session->base.session_signal, session); + wlr_signal_emit_safe(&session->base.session_signal, session); ioctl(session->tty_fd, VT_RELDISP, 1); } else { ioctl(session->tty_fd, VT_RELDISP, VT_ACKACQ); session->base.active = true; - wl_signal_emit(&session->base.session_signal, session); + wlr_signal_emit_safe(&session->base.session_signal, session); } return 1; diff --git a/backend/session/direct-ipc.c b/backend/session/direct-ipc.c index e7a169fa..6c69b70a 100644 --- a/backend/session/direct-ipc.c +++ b/backend/session/direct-ipc.c @@ -4,22 +4,22 @@ #define INPUT_MAJOR 0 #endif #include <errno.h> +#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <fcntl.h> -#include <unistd.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> +#include <unistd.h> +#include <wlr/config.h> +#include <wlr/util/log.h> +#include <xf86drm.h> #ifdef __linux__ #include <sys/sysmacros.h> #include <linux/major.h> #endif -#include <xf86drm.h> -#include <wlr/config.h> -#include <wlr/util/log.h> #include "backend/session/direct-ipc.h" enum { DRM_MAJOR = 226 }; diff --git a/backend/session/direct.c b/backend/session/direct.c index 9d6cd36d..13a26d99 100644 --- a/backend/session/direct.c +++ b/backend/session/direct.c @@ -1,21 +1,22 @@ #define _POSIX_C_SOURCE 200809L #include <errno.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdbool.h> -#include <unistd.h> +#include <linux/input.h> +#include <linux/kd.h> +#include <linux/major.h> +#include <linux/vt.h> #include <signal.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/sysmacros.h> -#include <linux/kd.h> -#include <linux/major.h> -#include <linux/input.h> -#include <linux/vt.h> +#include <unistd.h> #include <wayland-server.h> #include <wlr/backend/session/interface.h> #include <wlr/util/log.h> #include "backend/session/direct-ipc.h" +#include "util/signal.h" enum { DRM_MAJOR = 226 }; @@ -107,7 +108,7 @@ static int vt_handler(int signo, void *data) { if (session->base.active) { session->base.active = false; - wl_signal_emit(&session->base.session_signal, session); + wlr_signal_emit_safe(&session->base.session_signal, session); struct wlr_device *dev; wl_list_for_each(dev, &session->base.devices, link) { @@ -130,7 +131,7 @@ static int vt_handler(int signo, void *data) { } session->base.active = true; - wl_signal_emit(&session->base.session_signal, session); + wlr_signal_emit_safe(&session->base.session_signal, session); } return 1; diff --git a/backend/session/logind.c b/backend/session/logind.c index 1ece051f..f0ac1e93 100644 --- a/backend/session/logind.c +++ b/backend/session/logind.c @@ -1,25 +1,26 @@ #define _POSIX_C_SOURCE 200809L #include <assert.h> -#include <stdio.h> +#include <errno.h> +#include <fcntl.h> #include <stdbool.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <errno.h> -#include <unistd.h> -#include <sys/sysmacros.h> #include <sys/stat.h> -#include <fcntl.h> +#include <sys/sysmacros.h> +#include <unistd.h> #include <wayland-server.h> -#include <wlr/config.h> #include <wlr/backend/session/interface.h> +#include <wlr/config.h> #include <wlr/util/log.h> +#include "util/signal.h" #ifdef WLR_HAS_SYSTEMD #include <systemd/sd-bus.h> #include <systemd/sd-login.h> #elif defined(WLR_HAS_ELOGIND) #include <elogind/sd-bus.h> - #include <elogind/sd-login.h> + #include <elogind/sd-login.h> #endif enum { DRM_MAJOR = 226 }; @@ -250,7 +251,7 @@ static int pause_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_e if (major == DRM_MAJOR) { session->base.active = false; - wl_signal_emit(&session->base.session_signal, session); + wlr_signal_emit_safe(&session->base.session_signal, session); } if (strcmp(type, "pause") == 0) { @@ -286,7 +287,7 @@ static int resume_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_ if (!session->base.active) { session->base.active = true; - wl_signal_emit(&session->base.session_signal, session); + wlr_signal_emit_safe(&session->base.session_signal, session); } } diff --git a/backend/session/session.c b/backend/session/session.c index 2bbbd4ef..2d5d9776 100644 --- a/backend/session/session.c +++ b/backend/session/session.c @@ -1,18 +1,19 @@ #define _POSIX_C_SOURCE 200809L #include <assert.h> +#include <libudev.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> -#include <libudev.h> #include <wayland-server.h> -#include <xf86drm.h> -#include <xf86drmMode.h> -#include <wlr/config.h> #include <wlr/backend/session.h> #include <wlr/backend/session/interface.h> +#include <wlr/config.h> #include <wlr/util/log.h> +#include <xf86drm.h> +#include <xf86drmMode.h> +#include "util/signal.h" extern const struct session_impl session_logind; extern const struct session_impl session_direct; @@ -49,7 +50,7 @@ static int udev_event(int fd, uint32_t mask, void *data) { wl_list_for_each(dev, &session->devices, link) { if (dev->dev == devnum) { - wl_signal_emit(&dev->signal, session); + wlr_signal_emit_safe(&dev->signal, session); break; } } |