This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]