diff src/dumper.c @ 5727:86d33ddc7fd6

Avoid EOVERFLOW from stat() calls due to overflowing inode numbers. The btrfs filesystem now uses 64-bit inode numbers even on 32-bit systems. This can lead to spurious stat() failures, where EOVERFLOW is returned because the inode number does not fit into the 32-bit stat structure, even when the caller is not interested in the inode number. This patch builds with _FILE_OFFSET_BITS == 64 when possible, and deals with integers that may be too large to fit into a Lisp fixnum. For more information, see xemacs-patches message <CAHCOHQk_mPM6WgFChBsGafqhuazep6VED7swFoqfFXOV1r8org@mail.gmail.com>.
author Jerry James <james@xemacs.org>
date Wed, 06 Mar 2013 08:32:17 -0700
parents 25325da1d1a8
children 09b5be18ba0e
line wrap: on
line diff
--- a/src/dumper.c	Tue Mar 05 08:55:56 2013 +0100
+++ b/src/dumper.c	Wed Mar 06 08:32:17 2013 -0700
@@ -203,10 +203,10 @@
 inline static void
 pdump_align_stream (FILE *stream, Bytecount alignment)
 {
-  long offset = ftell (stream);
-  long adjustment = ALIGN_SIZE (offset, alignment) - offset;
+  OFF_T offset = FTELL (stream);
+  OFF_T adjustment = ALIGN_SIZE (offset, alignment) - offset;
   if (adjustment)
-    fseek (stream, adjustment, SEEK_CUR);
+    FSEEK (stream, adjustment, SEEK_CUR);
 }
 
 #define PDUMP_ALIGN_OUTPUT(type) pdump_align_stream (pdump_out, ALIGNOF (type))
@@ -2168,7 +2168,7 @@
 	elt->fcts->convert_free(elt->object, elt->data, elt->size);
     }
 
-  fseek (pdump_out, header.stab_offset, SEEK_SET);
+  FSEEK (pdump_out, header.stab_offset, SEEK_SET);
 
 #ifdef NEW_GC
   {