fix for test-fs-chmod
authorIgor Zinkovsky <igorzi@microsoft.com>
Fri, 9 Sep 2011 18:46:40 +0000 (11:46 -0700)
committerBert Belder <bertbelder@gmail.com>
Fri, 9 Sep 2011 19:09:59 +0000 (21:09 +0200)
test/simple/test-fs-chmod.js

index c40d4fc..b1ee4e5 100644 (file)
@@ -31,8 +31,8 @@ var is_windows = process.platform === 'win32';
 
 // On Windows chmod is only able to manipulate read-only bit
 if (is_windows) {
-  mode_async = 0400;  // read-only
-  mode_sync = 0600;   // read-write
+  mode_async = 0600;   // read-write
+  mode_sync = 0400;    // read-only
 } else {
   mode_async = 0777;
   mode_sync = 0644;
@@ -40,7 +40,7 @@ if (is_windows) {
 
 var file = path.join(common.fixturesDir, 'a.js');
 
-fs.chmod(file, mode_async.toString(), function(err) {
+fs.chmod(file, mode_async.toString(8), function(err) {
   if (err) {
     got_error = true;
   } else {
@@ -68,7 +68,7 @@ fs.open(file, 'a', function(err, fd) {
     console.error(err.stack);
     return;
   }
-  fs.fchmod(fd, mode_async.toString(), function(err) {
+  fs.fchmod(fd, mode_async.toString(8), function(err) {
     if (err) {
       got_error = true;
     } else {