##// END OF EJS Templates
vfs: use fchmod for _fixfilemode...
Matt Mackall -
r17752:76b73ce0 default
parent child Browse files
Show More
@@ -255,10 +255,10 b' class vfs(abstractvfs):'
255 255 def _cansymlink(self):
256 256 return util.checklink(self.base)
257 257
258 def _fixfilemode(self, name):
258 def _fixfilemode(self, fp):
259 259 if self.createmode is None:
260 260 return
261 os.chmod(name, self.createmode & 0666)
261 os.fchmod(fp.fileno(), self.createmode & 0666)
262 262
263 263 def __call__(self, path, mode="r", text=False, atomictemp=False):
264 264 if self._audit:
@@ -305,7 +305,7 b' class vfs(abstractvfs):'
305 305 util.rename(util.mktempcopy(f), f)
306 306 fp = util.posixfile(f, mode)
307 307 if nlink == 0:
308 self._fixfilemode(f)
308 self._fixfilemode(fp)
309 309 return fp
310 310
311 311 def symlink(self, src, dst):
@@ -329,8 +329,8 b' class vfs(abstractvfs):'
329 329 else:
330 330 f = self(dst, "w")
331 331 f.write(src)
332 self._fixfilemode(f)
332 333 f.close()
333 self._fixfilemode(dst)
334 334
335 335 def audit(self, path):
336 336 self.auditor(path)
General Comments 0
You need to be logged in to leave comments. Login now