diff options
| author | Lexi Winter <ivy@FreeBSD.org> | 2025-10-05 09:19:31 +0100 |
|---|---|---|
| committer | Lexi Winter <ivy@FreeBSD.org> | 2025-10-05 09:19:31 +0100 |
| commit | f85f2b2d6e5b7ed869376eb4b180c3a74a5c5da9 (patch) | |
| tree | ad799ccacfb459b809b02b9c115ed4befb93b4c1 /x11-wm/swayfx/files/patch-common_stringop.c | |
| parent | 0b1510fe1f98f82da6f3481cb6c58957022d9211 (diff) | |
| parent | b057c68280a2f2a7b3d1fbac36f7b034e1fdf593 (diff) | |
Merge remote-tracking branch 'freebsd/main' into lf/main
Diffstat (limited to 'x11-wm/swayfx/files/patch-common_stringop.c')
| -rw-r--r-- | x11-wm/swayfx/files/patch-common_stringop.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/x11-wm/swayfx/files/patch-common_stringop.c b/x11-wm/swayfx/files/patch-common_stringop.c deleted file mode 100644 index 5a9f187e11df..000000000000 --- a/x11-wm/swayfx/files/patch-common_stringop.c +++ /dev/null @@ -1,53 +0,0 @@ -https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191 - ---- common/stringop.c.orig 2025-04-20 11:31:10 UTC -+++ common/stringop.c -@@ -6,6 +6,8 @@ - #include <string.h> - #include <strings.h> - #include <wordexp.h> -+#include <signal.h> -+#include <sys/wait.h> - #include "list.h" - #include "log.h" - #include "stringop.h" -@@ -318,11 +320,34 @@ bool expand_path(char **path) { - char *ptr = strstr(*path, " ") + 1; - memmove(ptr + 1, ptr, strlen(ptr) + 1); - *ptr = '\\'; -- } -- if (wordexp(*path, &p, 0) != 0 || p.we_wordv[0] == NULL) { -- wordfree(&p); -- return false; -- } -+ } -+ -+ // FreeBSD wordexp bug workaround: -+ // 1. Reset SIGCHLD handler -+ // 2. Run wordexp -+ // 3. Restore SIGCHLD handler and reap any processes that exited -+ struct sigaction prev_action; -+ struct sigaction new_action = { -+ .sa_flags = SA_RESETHAND, -+ }; -+ if (sigaction(SIGCHLD, &new_action, &prev_action) != 0) { -+ sway_log(SWAY_ERROR, "Restoring sigchild before wordexp failed"); -+ return false; -+ } -+ -+ int res = wordexp(*path, &p, 0); -+ -+ if (sigaction(SIGCHLD, &prev_action, NULL) != 0) { -+ sway_log(SWAY_ERROR, "Restoring sigchild after wordexp failed"); -+ } -+ -+ int status; -+ while (waitpid(-1, &status, WNOHANG) != -1 || errno == EINTR); -+ -+ if (res != 0 || p.we_wordv[0] == NULL) { -+ wordfree(&p); -+ return false; -+ } - free(*path); - *path = join_args(p.we_wordv, p.we_wordc); - wordfree(&p); |
