]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
endfile.c (t_runc): Add cast to help case where ftruncate() prototype is somehow...
authorLoren J. Rittle <ljrittle@acm.org>
Tue, 15 May 2001 21:24:41 +0000 (21:24 +0000)
committerLoren J. Rittle <ljrittle@gcc.gnu.org>
Tue, 15 May 2001 21:24:41 +0000 (21:24 +0000)
* 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

libf2c/ChangeLog
libf2c/libI77/endfile.c

index 5206fa8b7c12753ee017e17922aa6be6623c5da3..c53502302592063245656f39f045bb9bacdd5137 100644 (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.
index 8e60d05f439ac6048c635e93e81e8b9185193474..7b009c7013d43b5af038a0f43687ddd85a1c67b5 100644 (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");