git: 2d6e34f9d399 - 2025Q3 - x11-wm/sway: unbreak config reload after bb43067a6928

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Mon, 15 Sep 2025 11:50:22 UTC
The branch 2025Q3 has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2d6e34f9d399a8f54d148adcdcf5f26d19a47ff2

commit 2d6e34f9d399a8f54d148adcdcf5f26d19a47ff2
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2025-09-15 11:23:52 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2025-09-15 11:50:08 +0000

    x11-wm/sway: unbreak config reload after bb43067a6928
    
    Obtained from:  upstream
    
    (cherry picked from commit fcab17cb653d35013194f69e9c97e906eb53a1ef)
---
 x11-wm/sway/Makefile                    | 1 +
 x11-wm/sway/files/extra-patch-wordexp   | 8 ++++++--
 x11-wm/swayfx/Makefile                  | 1 +
 x11-wm/swayfx/files/extra-patch-wordexp | 8 ++++++--
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/x11-wm/sway/Makefile b/x11-wm/sway/Makefile
index caf623eafae1..120ae0e8cd0a 100644
--- a/x11-wm/sway/Makefile
+++ b/x11-wm/sway/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	sway
 DISTVERSION=	1.11
+PORTREVISION=	1
 CATEGORIES=	x11-wm wayland
 
 MAINTAINER=	jbeich@FreeBSD.org
diff --git a/x11-wm/sway/files/extra-patch-wordexp b/x11-wm/sway/files/extra-patch-wordexp
index 5a9f187e11df..1209fefbe87e 100644
--- a/x11-wm/sway/files/extra-patch-wordexp
+++ b/x11-wm/sway/files/extra-patch-wordexp
@@ -1,4 +1,5 @@
 https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191
+https://github.com/swaywm/sway/issues/8828#issuecomment-3290045852
 
 --- common/stringop.c.orig	2025-04-20 11:31:10 UTC
 +++ common/stringop.c
@@ -11,7 +12,7 @@ https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191
  #include "list.h"
  #include "log.h"
  #include "stringop.h"
-@@ -318,11 +320,34 @@ bool expand_path(char **path) {
+@@ -318,11 +320,37 @@ bool expand_path(char **path) {
  		char *ptr = strstr(*path, "  ") + 1;
  		memmove(ptr + 1, ptr, strlen(ptr) + 1);
  		*ptr = '\\';
@@ -42,7 +43,10 @@ https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191
 +       }
 +
 +       int status;
-+       while (waitpid(-1, &status, WNOHANG) != -1 || errno == EINTR);
++       int wres;
++       do {
++               wres = waitpid(-1, &status, WNOHANG);
++       } while (wres > 0 || (wres == -1 && errno == EINTR));
 +
 +       if (res != 0 || p.we_wordv[0] == NULL) {
 +               wordfree(&p);
diff --git a/x11-wm/swayfx/Makefile b/x11-wm/swayfx/Makefile
index f53808ea6c88..8e4890d5cdef 100644
--- a/x11-wm/swayfx/Makefile
+++ b/x11-wm/swayfx/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	sway
 DISTVERSION=	0.5.3
+PORTREVISION=	1
 CATEGORIES=	x11-wm wayland
 PKGNAMESUFFIX=	${GH_PROJECT:S/${PORTNAME}//}
 
diff --git a/x11-wm/swayfx/files/extra-patch-wordexp b/x11-wm/swayfx/files/extra-patch-wordexp
index 5a9f187e11df..1209fefbe87e 100644
--- a/x11-wm/swayfx/files/extra-patch-wordexp
+++ b/x11-wm/swayfx/files/extra-patch-wordexp
@@ -1,4 +1,5 @@
 https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191
+https://github.com/swaywm/sway/issues/8828#issuecomment-3290045852
 
 --- common/stringop.c.orig	2025-04-20 11:31:10 UTC
 +++ common/stringop.c
@@ -11,7 +12,7 @@ https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191
  #include "list.h"
  #include "log.h"
  #include "stringop.h"
-@@ -318,11 +320,34 @@ bool expand_path(char **path) {
+@@ -318,11 +320,37 @@ bool expand_path(char **path) {
  		char *ptr = strstr(*path, "  ") + 1;
  		memmove(ptr + 1, ptr, strlen(ptr) + 1);
  		*ptr = '\\';
@@ -42,7 +43,10 @@ https://github.com/swaywm/sway/issues/8673#issuecomment-2818260191
 +       }
 +
 +       int status;
-+       while (waitpid(-1, &status, WNOHANG) != -1 || errno == EINTR);
++       int wres;
++       do {
++               wres = waitpid(-1, &status, WNOHANG);
++       } while (wres > 0 || (wres == -1 && errno == EINTR));
 +
 +       if (res != 0 || p.we_wordv[0] == NULL) {
 +               wordfree(&p);