From bd13238d9b47752e97d548b9a5477ecb8a2f21c2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Jan 2023 17:46:37 +0530 Subject: [PATCH] Should only return ENOTSUPP if SHM_DIR doesnt exist, not the fil we are trying to open --- tools/utils/shm/shm_fs.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/utils/shm/shm_fs.go b/tools/utils/shm/shm_fs.go index 326f62370..d5866f3b9 100644 --- a/tools/utils/shm/shm_fs.go +++ b/tools/utils/shm/shm_fs.go @@ -117,7 +117,9 @@ func Open(name string, size uint64) (MMap, error) { ans, err := os.OpenFile(file_path_from_name(name), os.O_RDONLY, 0) if err != nil { if errors.Is(err, fs.ErrNotExist) { - return nil, &ErrNotSupported{err: err} + if _, serr := os.Stat(SHM_DIR); serr != nil && errors.Is(serr, fs.ErrNotExist) { + return nil, &ErrNotSupported{err: serr} + } } return nil, err }