fastjar: Small _chsize/ftruncate fix

Bryce McKinlay mckinlay@redhat.com
Tue Jul 20 01:47:00 GMT 2004


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
 



More information about the Gcc-patches mailing list