changeset 14975:7b91ceb19771

[DJGPP v2]: Include fcntl.h. (copy_text_and_data) [DJGPP v2]: Call __djgpp_exception_toggle.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Apr 1996 04:15:13 +0000
parents b99490300747
children 63951d3f3995
files src/unexec.c
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/unexec.c	Wed Apr 10 04:13:40 1996 +0000
+++ b/src/unexec.c	Wed Apr 10 04:15:13 1996 +0000
@@ -176,6 +176,9 @@
 #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
@@ -876,6 +879,14 @@
 
 #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
@@ -890,6 +901,13 @@
   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 */