Commit 8eb2807f authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

[DJGPP v2]: Include fcntl.h.

(copy_text_and_data) [DJGPP v2]: Call __djgpp_exception_toggle.
parent 1bd7b2c7
...@@ -176,6 +176,9 @@ int need_coff_header = 1; ...@@ -176,6 +176,9 @@ int need_coff_header = 1;
#include <coff-encap/a.out.encap.h> /* The location might be a poor assumption */ #include <coff-encap/a.out.encap.h> /* The location might be a poor assumption */
#else #else
#ifdef MSDOS #ifdef MSDOS
#if __DJGPP__ > 1
#include <fcntl.h> /* for O_RDONLY, O_RDWR */
#endif
#include <coff.h> #include <coff.h>
#define filehdr external_filehdr #define filehdr external_filehdr
#define scnhdr external_scnhdr #define scnhdr external_scnhdr
...@@ -876,6 +879,14 @@ copy_text_and_data (new, a_out) ...@@ -876,6 +879,14 @@ copy_text_and_data (new, a_out)
#else /* COFF, but not USG_SHARED_LIBRARIES */ #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); lseek (new, (long) text_scnptr, 0);
ptr = (char *) f_ohdr.text_start; ptr = (char *) f_ohdr.text_start;
#ifdef HEADER_INCL_IN_TEXT #ifdef HEADER_INCL_IN_TEXT
...@@ -890,6 +901,13 @@ copy_text_and_data (new, a_out) ...@@ -890,6 +901,13 @@ copy_text_and_data (new, a_out)
end = ptr + f_ohdr.dsize; end = ptr + f_ohdr.dsize;
write_segment (new, ptr, end); write_segment (new, ptr, end);
#ifdef MSDOS
#if __DJGPP__ >= 2
/* Restore our exception hooks. */
__djgpp_exception_toggle ();
#endif
#endif
#endif /* USG_SHARED_LIBRARIES */ #endif /* USG_SHARED_LIBRARIES */
#else /* if not COFF */ #else /* if not COFF */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment