create temporary file in target dir

This commit is contained in:
Benoit Chesneau 2010-02-01 22:21:11 +01:00
parent c920d59332
commit ea9ccf0da1

View File

@ -76,7 +76,7 @@ class Arbiter(object):
self.unlink_pidfile(self.pidfile)
# write pidfile
fd, fname = tempfile.mkstemp()
fd, fname = tempfile.mkstemp(dir=os.path.dirname(path))
os.write(fd, "%s\n" % self.pid)
os.rename(fname, path)
os.close(fd)