small fix for linux file writing
parent
c1b0521e81
commit
230a54d83e
|
@ -679,7 +679,6 @@ Sys_Save_File_Sig(system_save_file){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t remaining = size;
|
|
||||||
do {
|
do {
|
||||||
ssize_t written = write(tmp_fd, data, size);
|
ssize_t written = write(tmp_fd, data, size);
|
||||||
if(written == -1){
|
if(written == -1){
|
||||||
|
@ -691,9 +690,10 @@ Sys_Save_File_Sig(system_save_file){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
remaining -= written;
|
size -= written;
|
||||||
|
data += written;
|
||||||
}
|
}
|
||||||
} while(remaining);
|
} while(size);
|
||||||
|
|
||||||
if(rename(tmp_fname, filename) == -1){
|
if(rename(tmp_fname, filename) == -1){
|
||||||
perror("system_save_file: rename");
|
perror("system_save_file: rename");
|
||||||
|
|
Loading…
Reference in New Issue