small fix for linux file writing

This commit is contained in:
insofaras 2016-02-23 19:40:35 +00:00
parent c1b0521e81
commit 230a54d83e
1 changed files with 3 additions and 3 deletions

View File

@ -679,7 +679,6 @@ Sys_Save_File_Sig(system_save_file){
return result;
}
size_t remaining = size;
do {
ssize_t written = write(tmp_fd, data, size);
if(written == -1){
@ -691,9 +690,10 @@ Sys_Save_File_Sig(system_save_file){
return result;
}
} else {
remaining -= written;
size -= written;
data += written;
}
} while(remaining);
} while(size);
if(rename(tmp_fname, filename) == -1){
perror("system_save_file: rename");