This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fastjar: Small _chsize/ftruncate fix
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Jul 2004 16:40:52 -0400
- Subject: fastjar: Small _chsize/ftruncate fix
Michael Koch pointed out that fastjar could try to use both _chsize and
ftruncate if a platform had both of these defined. This patch ensures we
only ever use one. I'm checking it in.
Bryce
2004-07-19 Bryce McKinlay <mckinlay@redhat.com>
* jartool.c (main): Ensure that only one of ftruncate and _chsize
is used.
--- jartool.c 19 Jul 2004 20:08:20 -0000 1.28
+++ jartool.c 19 Jul 2004 20:36:14 -0000
@@ -580,8 +580,7 @@
if (action == ACTION_UPDATE)
#if HAVE_FTRUNCATE
ftruncate (jarfd, lseek (jarfd, 0, SEEK_CUR));
-#endif
-#if HAVE__CHSIZE
+#else
_chsize (jarfd, lseek (jarfd, 0, SEEK_CUR));
#endif