pkg/safe: remove temporary file on failure (#1774)

This commit is contained in:
Bala FA
2016-05-27 10:13:33 +05:30
committed by Harshavardhana
parent d65101a8c8
commit 51bb613fdf
4 changed files with 84 additions and 87 deletions

View File

@@ -358,7 +358,7 @@ func (s fsStorage) CreateFile(volume, path string) (writeCloser io.WriteCloser,
return nil, errIsNotRegular
}
}
w, err := safe.CreateFileWithPrefix(filePath, "$tmpfile")
w, err := safe.CreateFile(filePath)
if err != nil {
// File path cannot be verified since one of the parents is a file.
if strings.Contains(err.Error(), "not a directory") {