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.387 by root, Mon Oct 15 23:49:10 2007 UTC vs.
Revision 1.388 by root, Thu Oct 18 02:56:13 2007 UTC

1081 close $fh; 1081 close $fh;
1082 1082
1083 if (@$objs) { 1083 if (@$objs) {
1084 if (my $fh = aio_open "$filename.pst~", O_WRONLY | O_CREAT, 0600) { 1084 if (my $fh = aio_open "$filename.pst~", O_WRONLY | O_CREAT, 0600) {
1085 chmod SAVE_MODE, $fh; 1085 chmod SAVE_MODE, $fh;
1086 my $data = Coro::Storable::blocking_nfreeze { version => 1, objs => $objs }; 1086 my $data = Coro::Storable::nfreeze { version => 1, objs => $objs };
1087 aio_write $fh, 0, (length $data), $data, 0; 1087 aio_write $fh, 0, (length $data), $data, 0;
1088 aio_fsync $fh if $cf::USE_FSYNC; 1088 aio_fsync $fh if $cf::USE_FSYNC;
1089 close $fh; 1089 close $fh;
1090 aio_rename "$filename.pst~", "$filename.pst"; 1090 aio_rename "$filename.pst~", "$filename.pst";
1091 } 1091 }
1122 1122
1123 unless (aio_stat "$filename.pst") { 1123 unless (aio_stat "$filename.pst") {
1124 (aio_load "$filename.pst", $av) >= 0 1124 (aio_load "$filename.pst", $av) >= 0
1125 or return; 1125 or return;
1126 1126
1127 my $st = eval { Coro::Storable::thaw $av } 1127 my $st = eval { Coro::Storable::thaw $av };
1128 || eval { my $guard = Coro::Storable::guard; Storable::thaw $av }; #d# compatibility, remove
1129 $av = $st->{objs}; 1128 $av = $st->{objs};
1130 } 1129 }
1131 1130
1132 utf8::decode (my $decname = $filename); 1131 utf8::decode (my $decname = $filename);
1133 warn sprintf "loading %s (%d,%d)\n", 1132 warn sprintf "loading %s (%d,%d)\n",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines