From e60db8075ca81be9ddbff4d3a3577bcafab51658 Mon Sep 17 00:00:00 2001 From: David Adam Date: Fri, 3 Jul 2015 15:31:03 +0800 Subject: [PATCH] Open universal variable lock file read/write and ignore errors Closes #2149. --- env_universal_common.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/env_universal_common.cpp b/env_universal_common.cpp index f90cc82bf..b493de210 100644 --- a/env_universal_common.cpp +++ b/env_universal_common.cpp @@ -698,7 +698,7 @@ bool env_universal_t::open_and_acquire_lock(const wcstring &path, int *out_fd) */ int result_fd = -1; bool needs_lock = true; - int flags = O_RDONLY | O_CREAT; + int flags = O_RDWR | O_CREAT; #ifdef O_EXLOCK flags |= O_EXLOCK; needs_lock = false; @@ -741,8 +741,7 @@ bool env_universal_t::open_and_acquire_lock(const wcstring &path, int *out_fd) /* error */ if (errno != EINTR) { - int err = errno; - report_error(err, L"Unable to lock universal variable file '%ls'", path.c_str()); + /* Do nothing per #2149 */ break; } }