summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2011-10-19 14:21:19 +0000
committerUrban Müller2011-10-19 14:21:19 +0000
commit26032604baf84a6e603bd7d47cde51e17dc58269 (patch)
tree5f056886209eada318b924133415fffe2543356d
parent10c8d19db9ad1639fa2b63bf3588ed7748817ed1 (diff)
downloaditools-26032604baf84a6e603bd7d47cde51e17dc58269.tar.gz
itools-26032604baf84a6e603bd7d47cde51e17dc58269.tar.bz2
itools-26032604baf84a6e603bd7d47cde51e17dc58269.zip
fix race
-rw-r--r--it.class7
1 files changed, 4 insertions, 3 deletions
diff --git a/it.class b/it.class
index 8d751a0..367908d 100644
--- a/it.class
+++ b/it.class
@@ -86,9 +86,10 @@ static function log($name /* ... */)
{
if (!file_exists($fullfn))
{
- @touch("$fullfn.tmp");
- @chgrp("$fullfn.tmp", "www");
- @rename("$fullfn.tmp", $fullfn);
+ $tmp = getmypid();
+ @touch("$fullfn.$tmp");
+ @chgrp("$fullfn.$tmp", "www");
+ @rename("$fullfn.$tmp", $fullfn);
@unlink($basefn);
@symlink($fullfn, $basefn);
}