The unified diff between revisions [a80e1661..] and [be157f28..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'file_io.cc'
#
#
# patch "file_io.cc"
# from [e39a1c13030c5378ea4cb3aa9621148ce0c8fb7d]
# to [c5541a89410a0194523e41bfcadb27f58124ee70]
#
============================================================
--- file_io.cc e39a1c13030c5378ea4cb3aa9621148ce0c8fb7d
+++ file_io.cc c5541a89410a0194523e41bfcadb27f58124ee70
@@ -359,7 +359,8 @@ write_data_impl(any_path const & p,
// nb: no mucking around with multiple-writer conditions. we're a
// single-user single-threaded program. you get what you paid for.
assert_path_is_directory(bookkeeping_root);
- bookkeeping_path tmp = bookkeeping_root / "data.tmp";
+ bookkeeping_path tmp = bookkeeping_root / (boost::format("data.tmp.%d") %
+ get_process_id()).str();
{
// data.tmp opens
@@ -371,9 +372,7 @@ write_data_impl(any_path const & p,
// data.tmp closes
}
- if (path_exists(p))
- N(fs::remove(mkdir(p)), F("removing %s failed") % p);
- fs::rename(mkdir(tmp), mkdir(p));
+ rename_clobberingly(tmp, p);
}
void