On windows, mkdir() doesn't take a mode parameter
authorBert Belder <bertbelder@gmail.com>
Thu, 25 Nov 2010 00:25:46 +0000 (01:25 +0100)
committerBert Belder <bertbelder@gmail.com>
Mon, 20 Dec 2010 22:50:42 +0000 (23:50 +0100)
src/node_file.cc

index f17cbfa..04f3f31 100644 (file)
@@ -518,7 +518,11 @@ static Handle<Value> MKDir(const Arguments& args) {
   if (args[2]->IsFunction()) {
     ASYNC_CALL(mkdir, args[2], *path, mode)
   } else {
+#ifdef __MINGW32__
+    int ret = mkdir(*path);
+#else
     int ret = mkdir(*path, mode);
+#endif
     if (ret != 0) return ThrowException(ErrnoException(errno, NULL, "", *path));
     return Undefined();
   }