1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-17 00:21:53 +02:00
openwrt-packages/emacs/patches/030-workaround-qemu-ftruncate.patch
David Kühling ed5db4233c emacs: enable second-stage "compilation" (i.e. dumping) via qemu
cuts startup time of emacs down to a few seconds
2011-06-26 10:46:33 +02:00

16 lines
700 B
Diff

Index: emacs-23.2/src/unexelf.c
===================================================================
--- emacs-23.2.orig/src/unexelf.c 2011-06-26 09:58:31.000000000 +0200
+++ emacs-23.2/src/unexelf.c 2011-06-26 10:00:40.000000000 +0200
@@ -827,7 +827,9 @@
new_file_size = stat_buf.st_size + old_file_h->e_shentsize + new_data2_incr;
- if (ftruncate (new_file, new_file_size))
+ /* this gives an error code when run via Qemu userspace emulation,
+ just ignoring the result code seems to fix the problem. */
+ if (ftruncate (new_file, new_file_size) && 0)
fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno);
new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE,