summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class11
1 files changed, 6 insertions, 5 deletions
diff --git a/it.class b/it.class
index b01285e..8d751a0 100644
--- a/it.class
+++ b/it.class
@@ -84,15 +84,16 @@ static function log($name /* ... */)
if (substr($fullfn, 0, 1) == "/")
{
- $existed = file_exists($fullfn);
- file_put_contents($fullfn, $line, FILE_APPEND);
-
- if (!$existed)
+ if (!file_exists($fullfn))
{
- @chgrp($fullfn, "www");
+ @touch("$fullfn.tmp");
+ @chgrp("$fullfn.tmp", "www");
+ @rename("$fullfn.tmp", $fullfn);
@unlink($basefn);
@symlink($fullfn, $basefn);
}
+
+ file_put_contents($fullfn, $line, FILE_APPEND);
}
}