Skip to content

Commit

Permalink
Back to my style in flush
Browse files Browse the repository at this point in the history
  • Loading branch information
louischatriot committed Jan 9, 2016
1 parent f916e69 commit 6d1f9cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ storage.flushToStorage = function (options, callback) {
if (err) { return callback(err); }
fs.fsync(fd, function (errFS) {
fs.close(fd, function (errC) {
var e = null;
if (errFS || errC) {
e = new Error('Failed to flush to storage');
var e = new Error('Failed to flush to storage');
e.errorOnFsync = errFS;
e.errorOnClose = errC;
return callback(e);
} else {
return callback(null);
}
return callback(e);
});
});
});
Expand Down

0 comments on commit 6d1f9cf

Please sign in to comment.