From 1e2732aa2198895fe6b3f37a19a93e7377bd1d23 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sun, 10 Jun 2018 15:41:20 +0200 Subject: [PATCH] lib/config, lib/model: Don't warn and return error (#4997) --- lib/config/folderconfiguration.go | 4 +--- lib/model/model.go | 11 ++++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/config/folderconfiguration.go b/lib/config/folderconfiguration.go index 11b31f020..edc1fd866 100644 --- a/lib/config/folderconfiguration.go +++ b/lib/config/folderconfiguration.go @@ -190,9 +190,7 @@ func (f *FolderConfiguration) CreateRoot() (err error) { filesystem := f.Filesystem() if _, err = filesystem.Stat("."); fs.IsNotExist(err) { - if err = filesystem.MkdirAll(".", permBits); err != nil { - l.Warnf("Creating directory for %v: %v", f.Description(), err) - } + err = filesystem.MkdirAll(".", permBits) } return err diff --git a/lib/model/model.go b/lib/model/model.go index cdaeb13cf..5a9146e04 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -231,13 +231,10 @@ func (m *Model) startFolderLocked(folder string) config.FolderType { // if these things don't work, we still want to start the folder and // it'll show up as errored later. - // Directory permission bits. Will be filtered down to something - // sane by umask on Unixes. - - cfg.CreateRoot() - - if err := cfg.CreateMarker(); err != nil { - l.Warnln("Creating folder marker:", err) + if err := cfg.CreateRoot(); err != nil { + l.Warnln("Failed to create folder root directory", err) + } else if err = cfg.CreateMarker(); err != nil { + l.Warnln("Failed to create folder marker:", err) } }