From: Zac Medico Date: Thu, 9 Feb 2006 04:25:56 +0000 (-0000) Subject: use write_atomic for the counter file X-Git-Tag: v2.1_pre5_2760~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d10752fe04b87affd5886f205ab817cb54513257;p=portage.git use write_atomic for the counter file svn path=/main/trunk/; revision=2686 --- diff --git a/pym/portage.py b/pym/portage.py index 339cd2e42..dd7775a5d 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -4142,12 +4142,7 @@ class dbapi: #increment counter counter += 1 # update new global counter file - newcpath=cpath+".new" - newcfile=open(newcpath,"w") - newcfile.write(str(counter)) - newcfile.close() - # now move global counter file into place - os.rename(newcpath,cpath) + write_atomic(cpath, str(counter)) return counter def invalidentry(self, mypath):