Select ordinary temporary file mode for copies and media blocks
This commit is contained in:
1 parent
12556344b0
commit
aa7a9b74f4
3 files changed
+3
-3
No files matched your search
@@ -164,7 +164,7 @@ int ma_copy_file(const char* source, const char* destination) {
|
||||
int status = file_io_paths(source, destination);
|
||||
uint64_t total = 0;
|
||||
if (status == 0) phase = "create temporary";
|
||||
if (status == 0 && file_io_temp_open(&output, destination)) status = -1;
|
||||
if (status == 0 && file_io_temp_open(&output, destination, 0)) status = -1;
|
||||
if (status == 0) {
|
||||
uint8_t buffer[65536]; size_t count;
|
||||
while (1) {
|
||||
|
||||
@@ -277,7 +277,7 @@ struct media_block_source* md_block_create(struct media_delivery_ctx* md, uint64
|
||||
source->entry = entry; source->md = md; source->refs = 1; source->owned = 1;
|
||||
source->group_id = group_id; source->chunk = chunk; source->size = size;
|
||||
memcpy(source->media_id, media_id, 16); memcpy(source->block_id, block_id, 16);
|
||||
if (file_io_temp_open(&source->storage, destination) || file_io_temp_finish(&source->storage)) {
|
||||
if (file_io_temp_open(&source->storage, destination, 0) || file_io_temp_finish(&source->storage)) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_MEDIA, "%s: block temp creation failed chunk=%u", MD_ID, chunk);
|
||||
md_block_release(source); return NULL;
|
||||
}
|
||||
|
||||
@@ -633,7 +633,7 @@ static int md_dl_register_servable(struct media_download* dl) {
|
||||
/* Запись назначения начинается только после проверки блоков. До publish старое имя сохраняет прежние байты. */
|
||||
static int md_dl_assemble(struct media_download* dl) {
|
||||
struct file_io_temp output = {0};
|
||||
int failed = file_io_temp_open(&output, dl->dest_path);
|
||||
int failed = file_io_temp_open(&output, dl->dest_path, 0);
|
||||
uint64_t total = 0;
|
||||
uint8_t buffer[65536];
|
||||
for (int bi = 0; bi < dl->num_blocks && !failed; bi++) {
|
||||
|
||||
Reference in new issue
Block a user