Back to my style in flush

pull/2/head
Louis Chatriot 9 years ago
parent f916e69717
commit 6d1f9cf20f
  1. 7
      lib/storage.js

@ -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); return callback(e);
} else {
return callback(null);
}
}); });
}); });
}); });

Loading…
Cancel
Save