# HG changeset patch # User Richard M. Stallman # Date 829109713 0 # Node ID 7b91ceb197711bbc162159835ede699c475f12ac # Parent b9949030074729e40a4d51ec6fb5062971ffbfa3 [DJGPP v2]: Include fcntl.h. (copy_text_and_data) [DJGPP v2]: Call __djgpp_exception_toggle. diff -r b99490300747 -r 7b91ceb19771 src/unexec.c --- 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 /* The location might be a poor assumption */ #else #ifdef MSDOS +#if __DJGPP__ > 1 +#include /* for O_RDONLY, O_RDWR */ +#endif #include #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 */