X-Git-Url: https://git.sesse.net/?p=plocate;a=blobdiff_plain;f=database-builder.cpp;fp=database-builder.cpp;h=f9dfb715391b3be7c4c521710d48f86b3b10795b;hp=419e012ca94c2625471680de17b67f07716ecec8;hb=994819bafa9d04be683130433a3f57e08e08422c;hpb=e4e68f1123bbcaaf87a5bf5bdf25af9a8c8eda70 diff --git a/database-builder.cpp b/database-builder.cpp index 419e012..f9dfb71 100644 --- a/database-builder.cpp +++ b/database-builder.cpp @@ -683,6 +683,10 @@ void DatabaseBuilder::finish_corpus() 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");