summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-04-04 19:12:44 +0200
committerAlyssa Ross <hi@alyssa.is>2024-04-04 19:54:19 +0200
commit8fa2b5411f4ad87525e5b9e98efff4e70f6fa656 (patch)
treef42494e0339c0892ed08dc5839961c4fc2c08e7e
parent81d53d4bdd7f9083b55a35696bcd72b95ffa3309 (diff)
downloadspectrum-8fa2b5411f4ad87525e5b9e98efff4e70f6fa656.tar
spectrum-8fa2b5411f4ad87525e5b9e98efff4e70f6fa656.tar.gz
spectrum-8fa2b5411f4ad87525e5b9e98efff4e70f6fa656.tar.bz2
spectrum-8fa2b5411f4ad87525e5b9e98efff4e70f6fa656.tar.lz
spectrum-8fa2b5411f4ad87525e5b9e98efff4e70f6fa656.tar.xz
spectrum-8fa2b5411f4ad87525e5b9e98efff4e70f6fa656.tar.zst
spectrum-8fa2b5411f4ad87525e5b9e98efff4e70f6fa656.zip
release/checks/wayland: fix race
The test might not have opened /run/surface-notify by the time the
surfaec appears.  In that case, opening the file write-only would
cause Weston to block, and cause a deadlock.  On Linux, we can open
the pipe read/write to have the open succeed immediately, avoiding
this problem.

Fixes: f76b542b ("release/checks/wayland: init")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
-rw-r--r--release/checks/wayland/surface-notify/module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/release/checks/wayland/surface-notify/module.c b/release/checks/wayland/surface-notify/module.c
index 7330eb1..549a209 100644
--- a/release/checks/wayland/surface-notify/module.c
+++ b/release/checks/wayland/surface-notify/module.c
@@ -23,7 +23,7 @@ static void on_commit(struct wl_listener *, struct weston_surface *surface)
 	if (strcmp(weston_desktop_surface_get_app_id(desktop_surface), APP_ID))
 		return;
 
-	if ((fd = open("/run/surface-notify", O_WRONLY)) == -1) {
+	if ((fd = open("/run/surface-notify", O_RDWR)) == -1) {
 		weston_log("opening /run/surface-notify: %s\n", strerror(errno));
 		return;
 	}