|
|
@ -59,13 +59,14 @@ storage.flushToStorage = function (options, callback) { |
|
|
|
if (err) { return callback(err); } |
|
|
|
if (err) { return callback(err); } |
|
|
|
fs.fsync(fd, function (errFS) { |
|
|
|
fs.fsync(fd, function (errFS) { |
|
|
|
fs.close(fd, function (errC) { |
|
|
|
fs.close(fd, function (errC) { |
|
|
|
var e = null; |
|
|
|
|
|
|
|
if (errFS || errC) { |
|
|
|
if (errFS || errC) { |
|
|
|
e = new Error('Failed to flush to storage'); |
|
|
|
var e = new Error('Failed to flush to storage'); |
|
|
|
e.errorOnFsync = errFS; |
|
|
|
e.errorOnFsync = errFS; |
|
|
|
e.errorOnClose = errC; |
|
|
|
e.errorOnClose = errC; |
|
|
|
|
|
|
|
return callback(e); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return callback(null); |
|
|
|
} |
|
|
|
} |
|
|
|
return callback(e); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|