]> code.delx.au - gnu-emacs/blobdiff - src/unexec.c
(set-auto-mode): Run multiple mode: specs in left-to-right order.
[gnu-emacs] / src / unexec.c
index 6b6136beaddd1d0a19f9f3e07d0aa89ff4bfafdd..7e2760159432063bf40d14e6a2ccb1ee752edb23 100644 (file)
@@ -14,7 +14,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 
 /*
@@ -175,6 +176,9 @@ int need_coff_header = 1;
 #include <coff-encap/a.out.encap.h> /* The location might be a poor assumption */
 #else
 #ifdef MSDOS
+#if __DJGPP__ > 1
+#include <fcntl.h>  /* for O_RDONLY, O_RDWR */
+#endif
 #include <coff.h>
 #define filehdr external_filehdr
 #define scnhdr external_scnhdr
@@ -875,6 +879,14 @@ copy_text_and_data (new, a_out)
 
 #else /* COFF, but not USG_SHARED_LIBRARIES */
 
+#ifdef MSDOS
+#if __DJGPP__ >= 2
+  /* Dump the original table of exception handlers, not the one
+     where our exception hooks are registered.  */
+  __djgpp_exception_toggle ();
+#endif
+#endif
+
   lseek (new, (long) text_scnptr, 0);
   ptr = (char *) f_ohdr.text_start;
 #ifdef HEADER_INCL_IN_TEXT
@@ -889,6 +901,13 @@ copy_text_and_data (new, a_out)
   end = ptr + f_ohdr.dsize;
   write_segment (new, ptr, end);
 
+#ifdef MSDOS
+#if __DJGPP__ >= 2
+  /* Restore our exception hooks.  */
+  __djgpp_exception_toggle ();
+#endif
+#endif
+
 #endif /* USG_SHARED_LIBRARIES */
 
 #else /* if not COFF */