aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren J. Rittle <ljrittle@acm.org>2001-05-15 21:24:41 +0000
committerLoren J. Rittle <ljrittle@gcc.gnu.org>2001-05-15 21:24:41 +0000
commitd2c4367503a4f48ce2590100ccc7278e46d333b4 (patch)
tree0ada4c387ea66329a80989e86344e9fdcc5bf19e
parent7edc73b46ae4ef8b29ddbfb2e6e81cff18987fec (diff)
downloadgcc-d2c4367503a4f48ce2590100ccc7278e46d333b4.zip
gcc-d2c4367503a4f48ce2590100ccc7278e46d333b4.tar.gz
gcc-d2c4367503a4f48ce2590100ccc7278e46d333b4.tar.bz2
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
-rw-r--r--libf2c/ChangeLog6
-rw-r--r--libf2c/libI77/endfile.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog
index 5206fa8..c535023 100644
--- a/libf2c/ChangeLog
+++ b/libf2c/ChangeLog
@@ -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.
diff --git a/libf2c/libI77/endfile.c b/libf2c/libI77/endfile.c
index 8e60d05..7b009c7 100644
--- a/libf2c/libI77/endfile.c
+++ b/libf2c/libI77/endfile.c
@@ -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");