Skip to content

Commit

Permalink
if we got an exception when reading the displayfd, we could end up ha…
Browse files Browse the repository at this point in the history
…ving 'buf' undefined, causing a bug - just bail out sooner if we can't read the displayfd

git-svn-id: https://xpra.org/svn/Xpra/trunk@21079 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 23, 2018
1 parent 7257e40 commit b1c6a9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/xpra/x11/vfb_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ def pathexpand(s):
xvfb = None
try:
if use_display_fd:
def displayfd_err(msg):
raise InitException("%s: %s" % (xvfb_executable, msg))
r_pipe, w_pipe = os.pipe()
try:
if PYTHON3:
Expand All @@ -251,13 +253,10 @@ def preexec():
buf = read_displayfd(r_pipe)
except Exception as e:
log("read_displayfd(%s)", r_pipe, exc_info=True)
log.error("Error reading displayfd pipe %s:", r_pipe)
log.error(" %s", e)
displayfd_err("failed to read displayfd pipe %s: %s" % (r_pipe, e))
finally:
osclose(r_pipe)
osclose(w_pipe)
def displayfd_err(msg):
raise InitException("%s: %s" % (xvfb_executable, msg))
n = parse_displayfd(buf, displayfd_err)
new_display_name = ":%s" % n
log("Using display number provided by %s: %s", xvfb_executable, new_display_name)
Expand Down

0 comments on commit b1c6a9e

Please sign in to comment.