Report and patch by Grisha Levit; see
https://unix.stackexchange.com/questions/739150/var-lib-plocate-plocate-db-has-version-
4294967295-expected-0-or-1-please-reb/761248#761248
for the entire story.
fseek(outfp, 0, SEEK_SET);
fwrite(&hdr, sizeof(hdr), 1, outfp);
+ // This is needed on systems that simulate linkat() by copying
+ // the contents of the file instead of linking.
+ fflush(outfp);
+
if (!temp_filename.empty()) {
if (rename(temp_filename.c_str(), outfile.c_str()) == -1) {
perror("rename");