endfile.c (t_runc): Add cast to help case where ftruncate() prototype is somehow missing even...

* libI77/endfile.c (t_runc): Add cast to help case where
	ftruncate() prototype is somehow missing even though autoconf
	test found it properly.

From-SVN: r42120
This commit is contained in:
Loren J. Rittle 2001-05-15 21:24:41 +00:00 committed by Loren J. Rittle
parent 7edc73b46a
commit d2c4367503
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2001-05-15 Loren J. Rittle <ljrittle@acm.org>
* libI77/endfile.c (t_runc): Add cast to help case where
ftruncate() prototype is somehow missing even though autoconf
test found it properly.
2001-02-26 Toon Moene <toon@moene.indiv.nluug.nl>
* libI77/configure.in: Test for ftruncate.

View File

@ -129,7 +129,10 @@ done:
f__cf = b->ufd = bf;
#else /* !defined(HAVE_FTRUNCATE) */
fflush(b->ufd);
rc = ftruncate(fileno(b->ufd),loc);
/* The cast of loc is helpful on FreeBSD. It helps
in any case where ftruncate() prototype is somehow missing
even though autoconf test found it properly. */
rc = ftruncate(fileno(b->ufd), (off_t)loc);
#endif /* !defined(HAVE_FTRUNCATE) */
if (rc)
err(a->aerr,111,"endfile");