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

@@ -167,7 +167,7 @@ func safeCloseAndRemove(writer io.WriteCloser) error {
// If writer is a safe file, Attempt to close and remove.
safeWriter, ok := writer.(*safe.File)
if ok {
return safeWriter.CloseAndRemove()
return safeWriter.Abort()
}
wCloser, ok := writer.(*waitCloser)
if ok {