From c8da246a3ab6b24ecda843f4d9a9fd20b872e754 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 12 Sep 2010 20:26:16 -0700 Subject: [PATCH] filestore: handle error opening fsid on mkjournal --- src/os/FileStore.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index f69c5582d61d2..7b6eb371f3814 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -379,6 +379,8 @@ int FileStore::mkjournal() char fn[PATH_MAX]; snprintf(fn, sizeof(fn), "%s/fsid", basedir.c_str()); int fd = ::open(fn, O_RDONLY, 0644); + if (fd < 0) + return -errno; ::read(fd, &fsid, sizeof(fsid)); ::close(fd); -- 2.39.5