From 6c53862ff1cc7ada37f76a2fdabf85f3c3ba40d9 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 1 Jun 2015 19:20:25 -0700 Subject: [PATCH] Suppress uvar error messages due to permissions or file not found su does not reset XDG_RUNTIME_DIR, which means that XDG_RUNTIME_DIR may point to directories that the user does not have permission to access. Similarly there is no guarantee that XDG_RUNTIME_DIR points to a directory that actually exists. Rather than try to handle these issues, we simply ignore them, effectively disabling realtime uvar notifications. Fixes #1955. --- env_universal_common.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/env_universal_common.cpp b/env_universal_common.cpp index a8d45bcd9..f90cc82bf 100644 --- a/env_universal_common.cpp +++ b/env_universal_common.cpp @@ -1376,7 +1376,13 @@ class universal_notifier_named_pipe_t : public universal_notifier_t { // Maybe open failed, maybe mkfifo failed int err = errno; - report_error(err, L"Unable to make or open a FIFO for universal variables with path '%ls'", vars_path.c_str()); + // We explicitly do NOT report an error for ENOENT or EACCESS + // This works around #1955, where $XDG_RUNTIME_DIR may get a bogus value under suc + if (err != ENOENT && err != EPERM) + { + report_error(err, L"Unable to make or open a FIFO for universal variables with path '%ls'", vars_path.c_str()); + } + pipe_fd= -1; } else {