X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/6f25b662588328caa8032366653896277d99fb9a..4cc1cf917ec78bc543924602c472a56cbf77ba70:/agedu.c diff --git a/agedu.c b/agedu.c index 7fd2314..411ae6a 100644 --- a/agedu.c +++ b/agedu.c @@ -1246,7 +1246,8 @@ int main(int argc, char **argv) indexbuild_free(ib); munmap(mappedfile, totalsize); - ftruncate(fd, realsize); + if (ftruncate(fd, realsize) < 0) + fatal("%s: truncate: %s\n", filename, strerror(errno)); close(fd); printf("Final index file size = %llu bytes\n", (unsigned long long)realsize);