Skip to content

Commit

Permalink
#4049 also exit on IO_ERR, always terminate watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 13, 2023
1 parent c81abe7 commit 713009f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xpra/client/mixins/window_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ def watcher_terminated(*args):
log("using watcher pid=%i for server pid=%i", proc.pid, pid)
self._pid_to_signalwatcher[pid] = proc
proc.stdout_io_watch = GLib.io_add_watch(proc.stdout,
GLib.PRIORITY_DEFAULT, GLib.IO_IN,
GLib.PRIORITY_DEFAULT, GLib.IO_IN | GLib.IO_HUP | GLib.IO_ERR,
self.signal_watcher_event, proc, pid, wid)
if proc:
self._signalwatcher_to_wids.setdefault(proc, []).append(wid)
Expand All @@ -984,8 +984,8 @@ def watcher_terminated(*args):

def signal_watcher_event(self, fd, cb_condition, proc, pid:int, wid:int) -> bool:
log("signal_watcher_event%s", (fd, cb_condition, proc, pid, wid))
if cb_condition==GLib.IO_HUP:
proc.stdout_io_watch = None
if cb_condition in (GLib.IO_HUP, GLib.IO_ERR):
kill_signalwatcher(proc)
return False
if proc.stdout_io_watch is None:
#no longer watched
Expand Down

0 comments on commit 713009f

Please sign in to comment.