comparison 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
comparison
equal deleted inserted replaced
5726:179f4a9201b5 5727:86d33ddc7fd6
201 201
202 202
203 inline static void 203 inline static void
204 pdump_align_stream (FILE *stream, Bytecount alignment) 204 pdump_align_stream (FILE *stream, Bytecount alignment)
205 { 205 {
206 long offset = ftell (stream); 206 OFF_T offset = FTELL (stream);
207 long adjustment = ALIGN_SIZE (offset, alignment) - offset; 207 OFF_T adjustment = ALIGN_SIZE (offset, alignment) - offset;
208 if (adjustment) 208 if (adjustment)
209 fseek (stream, adjustment, SEEK_CUR); 209 FSEEK (stream, adjustment, SEEK_CUR);
210 } 210 }
211 211
212 #define PDUMP_ALIGN_OUTPUT(type) pdump_align_stream (pdump_out, ALIGNOF (type)) 212 #define PDUMP_ALIGN_OUTPUT(type) pdump_align_stream (pdump_out, ALIGNOF (type))
213 213
214 #define PDUMP_WRITE(type, object) \ 214 #define PDUMP_WRITE(type, object) \
2166 pdump_cv_ptr_info *elt = Dynarr_atp (pdump_cv_ptr, i); 2166 pdump_cv_ptr_info *elt = Dynarr_atp (pdump_cv_ptr, i);
2167 if(elt->fcts->convert_free) 2167 if(elt->fcts->convert_free)
2168 elt->fcts->convert_free(elt->object, elt->data, elt->size); 2168 elt->fcts->convert_free(elt->object, elt->data, elt->size);
2169 } 2169 }
2170 2170
2171 fseek (pdump_out, header.stab_offset, SEEK_SET); 2171 FSEEK (pdump_out, header.stab_offset, SEEK_SET);
2172 2172
2173 #ifdef NEW_GC 2173 #ifdef NEW_GC
2174 { 2174 {
2175 EMACS_INT zero = 0; 2175 EMACS_INT zero = 0;
2176 pdump_scan_lisp_objects_by_alignment (pdump_dump_mc_data); 2176 pdump_scan_lisp_objects_by_alignment (pdump_dump_mc_data);