diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2022-07-27 01:15:51 -0400 |
---|---|---|
committer | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2022-07-27 01:15:51 -0400 |
commit | bf371d05afedcaa67bb9ccf54f2f533c3adacf9a (patch) | |
tree | 9431e7879a52d769c6ede7d2428e152810ba2dd8 /eclass | |
parent | 42d3f03d158978695bde7a5bafb10c9305d2d9c8 (diff) | |
download | gentoo-overlay-bf371d05afedcaa67bb9ccf54f2f533c3adacf9a.tar.xz gentoo-overlay-bf371d05afedcaa67bb9ccf54f2f533c3adacf9a.zip |
virtualwl.eclass: use blocking read instead of kill
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/virtualwl.eclass | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/eclass/virtualwl.eclass b/eclass/virtualwl.eclass index 162f615..d2715bc 100644 --- a/eclass/virtualwl.eclass +++ b/eclass/virtualwl.eclass @@ -99,7 +99,8 @@ virtwl() { # TODO: don't run addpredict in utility function. WLR_RENDERER=pixman doesn't work addpredict /dev/dri - coproc VIRTWL { WLR_BACKENDS=headless exec tinywl -s 'echo $WAYLAND_DISPLAY'; } + local VIRTWL VIRTWL_PID + coproc VIRTWL { WLR_BACKENDS=headless exec tinywl -s 'echo $WAYLAND_DISPLAY; read _; kill $PPID'; } local -x WAYLAND_DISPLAY read WAYLAND_DISPLAY <&${VIRTWL[0]} @@ -108,7 +109,7 @@ virtwl() { retval=$? [[ -n $VIRTWL_PID ]] || die "tinywl exited unexpectedly" - kill $VIRTWL_PID + exec {VIRTWL[0]}<&- {VIRTWL[1]}>&- [[ $retval = 0 ]] || die "Failed to run '$@'" } |