diff options
| author | Eli Zaretskii | 2012-11-05 18:30:45 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-11-05 18:30:45 +0200 |
| commit | c8e3a9c3db7dfb5a04ec2bf4b1aae55809f94de4 (patch) | |
| tree | 92ff26bdd297d964d44f44c1f73a341a0b286f4a /src/w32fns.c | |
| parent | 4f3f021d65aa712f871c498579ca549f5f5247ab (diff) | |
| download | emacs-c8e3a9c3db7dfb5a04ec2bf4b1aae55809f94de4.tar.gz emacs-c8e3a9c3db7dfb5a04ec2bf4b1aae55809f94de4.zip | |
Fix bug #12805 with compilation error in the cygw32 build.
src/makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
src/w32fns.c Include unistd.h, to avoid compiler warnings on Cygwin.
(emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
file descriptor 2 for standard error.
Diffstat (limited to 'src/w32fns.c')
| -rw-r--r-- | src/w32fns.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 74bb2375ea5..18e29ecaaf5 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -27,6 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 27 | #include <errno.h> | 27 | #include <errno.h> |
| 28 | #include <math.h> | 28 | #include <math.h> |
| 29 | #include <fcntl.h> | 29 | #include <fcntl.h> |
| 30 | #include <unistd.h> | ||
| 30 | 31 | ||
| 31 | #include "lisp.h" | 32 | #include "lisp.h" |
| 32 | #include "w32term.h" | 33 | #include "w32term.h" |
| @@ -7749,12 +7750,19 @@ emacs_abort (void) | |||
| 7749 | 7750 | ||
| 7750 | if (i) | 7751 | if (i) |
| 7751 | { | 7752 | { |
| 7753 | #ifdef CYGWIN | ||
| 7754 | int stderr_fd = 2; | ||
| 7755 | #else | ||
| 7752 | HANDLE errout = GetStdHandle (STD_ERROR_HANDLE); | 7756 | HANDLE errout = GetStdHandle (STD_ERROR_HANDLE); |
| 7753 | int stderr_fd = -1, errfile_fd = -1; | 7757 | int stderr_fd = -1; |
| 7758 | #endif | ||
| 7759 | int errfile_fd = -1; | ||
| 7754 | int j; | 7760 | int j; |
| 7755 | 7761 | ||
| 7762 | #ifndef CYGWIN | ||
| 7756 | if (errout && errout != INVALID_HANDLE_VALUE) | 7763 | if (errout && errout != INVALID_HANDLE_VALUE) |
| 7757 | stderr_fd = _open_osfhandle ((intptr_t)errout, O_APPEND | O_BINARY); | 7764 | stderr_fd = _open_osfhandle ((intptr_t)errout, O_APPEND | O_BINARY); |
| 7765 | #endif | ||
| 7758 | if (stderr_fd >= 0) | 7766 | if (stderr_fd >= 0) |
| 7759 | write (stderr_fd, "\r\nBacktrace:\r\n", 14); | 7767 | write (stderr_fd, "\r\nBacktrace:\r\n", 14); |
| 7760 | errfile_fd = _open ("emacs_backtrace.txt", O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE); | 7768 | errfile_fd = _open ("emacs_backtrace.txt", O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE); |