[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `message' not outputting the newline "atomically"
From: |
Lars Ingebrigtsen |
Subject: |
Re: `message' not outputting the newline "atomically" |
Date: |
Mon, 24 Jun 2019 21:48:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
So... does this look OK?
diff --git a/src/xdisp.c b/src/xdisp.c
index 5d70440f1c..0b45ca9e02 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10705,10 +10705,22 @@ message_to_stderr (Lisp_Object m)
else
s = m;
- fwrite (SDATA (s), SBYTES (s), 1, stderr);
+ /* We want to write this out with a single fwrite call so that
+ output doesn't interleave with other processes writing to
+ stderr at the same time. */
+ {
+ int length = SBYTES (s);
+ char *string = xmalloc (length + 1);
+
+ memcpy (string, SSDATA (s), length);
+ *(string + length) = '\n';
+ fwrite (string, length + 1, 1, stderr);
+ xfree (string);
+ }
}
- if (!cursor_in_echo_area)
+ else if (!cursor_in_echo_area)
fputc ('\n', stderr);
+
fflush (stderr);
}
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: `message' not outputting the newline "atomically", (continued)
- Re: `message' not outputting the newline "atomically", Stefan Monnier, 2019/06/20
- Re: `message' not outputting the newline "atomically", Paul Eggert, 2019/06/20
- Re: `message' not outputting the newline "atomically", Daniele Nicolodi, 2019/06/23
- Re: `message' not outputting the newline "atomically", Paul Eggert, 2019/06/23
- Re: `message' not outputting the newline "atomically", Lars Ingebrigtsen, 2019/06/23
- Re: `message' not outputting the newline "atomically", Paul Eggert, 2019/06/23
- Re: `message' not outputting the newline "atomically", Lars Ingebrigtsen, 2019/06/23
- Re: `message' not outputting the newline "atomically", Daniele Nicolodi, 2019/06/23
- Re: `message' not outputting the newline "atomically", Eli Zaretskii, 2019/06/23
- Re: `message' not outputting the newline "atomically", HaiJun Zhang, 2019/06/23
Re: `message' not outputting the newline "atomically",
Lars Ingebrigtsen <=
- Re: `message' not outputting the newline "atomically", Daniele Nicolodi, 2019/06/24
- Re: `message' not outputting the newline "atomically", Lars Ingebrigtsen, 2019/06/24
- Re: `message' not outputting the newline "atomically", Paul Eggert, 2019/06/24
- Re: `message' not outputting the newline "atomically", Lars Ingebrigtsen, 2019/06/24
- Re: `message' not outputting the newline "atomically", Paul Eggert, 2019/06/24
- Re: `message' not outputting the newline "atomically", Paul Eggert, 2019/06/24
- Re: `message' not outputting the newline "atomically", Lars Ingebrigtsen, 2019/06/24
- Re: `message' not outputting the newline "atomically", Lars Ingebrigtsen, 2019/06/24
- Re: `message' not outputting the newline "atomically", Eli Zaretskii, 2019/06/25
- Re: `message' not outputting the newline "atomically", Lars Ingebrigtsen, 2019/06/26