fs: remove duplicate check
authorBrian White <mscdex@mscdex.net>
Sat, 7 Jun 2014 15:53:23 +0000 (11:53 -0400)
committerFedor Indutny <fedor@indutny.com>
Sun, 8 Jun 2014 17:01:23 +0000 (10:01 -0700)
Signed-off-by: Fedor Indutny <fedor@indutny.com>
lib/fs.js

index 8f95d62..990eb6d 100644 (file)
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -944,7 +944,7 @@ fs.writeFile = function(path, data, options, callback) {
   assertEncoding(options.encoding);
 
   var flag = options.flag || 'w';
-  fs.open(path, options.flag || 'w', options.mode, function(openErr, fd) {
+  fs.open(path, flag, options.mode, function(openErr, fd) {
     if (openErr) {
       if (callback) callback(openErr);
     } else {