diff options
| author | Paul Eggert | 2016-04-04 09:36:30 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-04 09:44:19 -0700 |
| commit | 6bccb19c9bef1189c8e853ff7cc16b889a3a57e3 (patch) | |
| tree | 9555d6605362ec0c452b343d549d2af3c983415d /src/regex.c | |
| parent | a11756ad0e2ee719266c0081150c20996cce8e0d (diff) | |
| download | emacs-6bccb19c9bef1189c8e853ff7cc16b889a3a57e3.tar.gz emacs-6bccb19c9bef1189c8e853ff7cc16b889a3a57e3.zip | |
Port redirect-debugging-output to non-GNU/Linux
Problem reported by Kylie McClain for musl in:
http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01592.html
* etc/DEBUG, etc/NEWS: Mention this.
* src/callproc.c (child_setup) [!MSDOS]:
* src/dispnew.c (init_display):
* src/emacs.c (main, Fdaemon_initialized):
* src/minibuf.c (read_minibuf_noninteractive):
* src/regex.c (xmalloc, xrealloc):
Prefer symbolic names like STDERR_FILENO to magic numbers like 2,
to make file-descriptor manipulation easier to follow.
* src/emacs.c (relocate_fd) [!WINDOWSNT]: Remove; no longer needed
now that we make sure stdin, stdout and stderr are open. All uses
removed.
(main): Make sure standard FDs are OK. Prefer symbolic names like
EXIT_FAILURE to magic numbers like 1. Use bool for boolean.
* src/lisp.h (init_standard_fds): New decl.
* src/print.c (WITH_REDIRECT_DEBUGGING_OUTPUT) [GNU_LINUX]:
Remove; no longer needed.
(Fredirect_debugging_output): Define on all platforms, not just
GNU/Linux. Redirect file descriptor, not stream, so that the code
works even if stderr is not an lvalue. Report an error if the
file arg is neither a string nor nil.
(syms_of_print): Always define redirect-debugging-output.
* src/sysdep.c (force_open, init_standard_fds): New functions.
Diffstat (limited to 'src/regex.c')
| -rw-r--r-- | src/regex.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regex.c b/src/regex.c index d5c58aeaf8b..af379367be6 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -215,7 +215,7 @@ xmalloc (size_t size) | |||
| 215 | void *val = malloc (size); | 215 | void *val = malloc (size); |
| 216 | if (!val && size) | 216 | if (!val && size) |
| 217 | { | 217 | { |
| 218 | write (2, "virtual memory exhausted\n", 25); | 218 | write (STDERR_FILENO, "virtual memory exhausted\n", 25); |
| 219 | exit (1); | 219 | exit (1); |
| 220 | } | 220 | } |
| 221 | return val; | 221 | return val; |
| @@ -233,7 +233,7 @@ xrealloc (void *block, size_t size) | |||
| 233 | val = realloc (block, size); | 233 | val = realloc (block, size); |
| 234 | if (!val && size) | 234 | if (!val && size) |
| 235 | { | 235 | { |
| 236 | write (2, "virtual memory exhausted\n", 25); | 236 | write (STDERR_FILENO, "virtual memory exhausted\n", 25); |
| 237 | exit (1); | 237 | exit (1); |
| 238 | } | 238 | } |
| 239 | return val; | 239 | return val; |