$OpenBSD: patch-deps_npm_lib_utils_cmd-shim_js,v 1.1 2012/06/28 08:30:28 jasper Exp $
--- deps/npm/lib/utils/cmd-shim.js.orig	Mon Jun 25 10:35:23 2012
+++ deps/npm/lib/utils/cmd-shim.js	Mon Jun 25 10:36:48 2012
@@ -148,7 +148,16 @@ function writeShim_ (from, to, prog, args, cb) {
         log.warn("shShim", "Could not write "+to)
         return cb(er)
       }
-      fs.chmod(to, 0755, cb)
+      fs.stat(to, function (er, stats) {
+        if (er) {
+          log.warn("Could not get stats for "+to, "shShim")
+          return cb(er)
+        }
+        if (stats.mode == 0755) {
+          return cb(er)
+        }
+        fs.chmod(to, 0755, cb)
+      })
     })
   })
 }
