ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.472 by root, Sat Jun 6 21:43:13 2009 UTC vs.
Revision 1.473 by root, Fri Jun 26 16:32:10 2009 UTC

1151 $decname, length $$rdata, scalar @$objs; 1151 $decname, length $$rdata, scalar @$objs;
1152 1152
1153 if (my $fh = aio_open "$filename~", O_WRONLY | O_CREAT, 0600) { 1153 if (my $fh = aio_open "$filename~", O_WRONLY | O_CREAT, 0600) {
1154 aio_chmod $fh, SAVE_MODE; 1154 aio_chmod $fh, SAVE_MODE;
1155 aio_write $fh, 0, (length $$rdata), $$rdata, 0; 1155 aio_write $fh, 0, (length $$rdata), $$rdata, 0;
1156 aio_fsync $fh if $cf::USE_FSYNC; 1156 if ($cf::USE_FSYNC) {
1157 aio_sync_file_range $fh, 0, 0, IO::AIO::SYNC_FILE_RANGE_WAIT_BEFORE | IO::AIO::SYNC_FILE_RANGE_WRITE | IO::AIO::SYNC_FILE_RANGE_WAIT_AFTER;
1158 aio_fsync $fh;
1159 }
1157 aio_close $fh; 1160 aio_close $fh;
1158 1161
1159 if (@$objs) { 1162 if (@$objs) {
1160 if (my $fh = aio_open "$filename.pst~", O_WRONLY | O_CREAT, 0600) { 1163 if (my $fh = aio_open "$filename.pst~", O_WRONLY | O_CREAT, 0600) {
1161 aio_chmod $fh, SAVE_MODE; 1164 aio_chmod $fh, SAVE_MODE;
1162 my $data = Coro::Storable::nfreeze { version => 1, objs => $objs }; 1165 my $data = Coro::Storable::nfreeze { version => 1, objs => $objs };
1163 aio_write $fh, 0, (length $data), $data, 0; 1166 aio_write $fh, 0, (length $data), $data, 0;
1164 aio_fsync $fh if $cf::USE_FSYNC; 1167 if ($cf::USE_FSYNC) {
1168 aio_sync_file_range $fh, 0, 0, IO::AIO::SYNC_FILE_RANGE_WAIT_BEFORE | IO::AIO::SYNC_FILE_RANGE_WRITE | IO::AIO::SYNC_FILE_RANGE_WAIT_AFTER;
1169 aio_fsync $fh;
1170 }
1165 aio_close $fh; 1171 aio_close $fh;
1166 aio_rename "$filename.pst~", "$filename.pst"; 1172 aio_rename "$filename.pst~", "$filename.pst";
1167 } 1173 }
1168 } else { 1174 } else {
1169 aio_unlink "$filename.pst"; 1175 aio_unlink "$filename.pst";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines