|
@@ -118,6 +118,7 @@ function tripal_file_upload_merge($filename, $type, $user_dir) {
|
|
|
$status = 'failed';
|
|
|
$message = 'Cannot open merged file: ' . $merge_file . '.';
|
|
|
}
|
|
|
+ flock($merge_fh, LOCK_UN);
|
|
|
fclose($merge_fh);
|
|
|
}
|
|
|
|
|
@@ -234,6 +235,7 @@ function tripal_file_upload_put($filename, $chunk, $user_dir) {
|
|
|
while ($data = fread($putdata, 1024)) {
|
|
|
fwrite($fh, $data);
|
|
|
}
|
|
|
+ flock($fh, LOCK_UN);
|
|
|
fclose($fh);
|
|
|
}
|
|
|
}
|
|
@@ -271,6 +273,7 @@ function tripal_file_upload_read_log($temp_dir) {
|
|
|
}
|
|
|
$log = unserialize($contents);
|
|
|
}
|
|
|
+ flock($fh, LOCK_UN);
|
|
|
fclose($fh);
|
|
|
}
|
|
|
if (!is_array($log)) {
|
|
@@ -309,5 +312,6 @@ function tripal_file_upoad_write_log($temp_dir, $log) {
|
|
|
if ($fh and flock($fh, LOCK_EX)) {
|
|
|
fwrite($fh, serialize($log));
|
|
|
}
|
|
|
+ flock($fh, LOCK_UN);
|
|
|
fclose($fh);
|
|
|
-}
|
|
|
+}
|