~mdw
/
sgt
/
agedu
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f25b66
)
Check the return value of ftruncate(), mostly to stop Ubuntu 12.04's
author
simon
<simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 3 May 2012 17:46:25 +0000
(17:46 +0000)
committer
simon
<simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 3 May 2012 17:46:25 +0000
(17:46 +0000)
gcc complaining.
git-svn-id: svn://svn.tartarus.org/sgt/agedu@9479
cda61777
-01e9-0310-a592-
d414129be87e
agedu.c
patch
|
blob
|
blame
|
history
diff --git
a/agedu.c
b/agedu.c
index
7fd2314
..
411ae6a
100644
(file)
--- 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);