[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Truncated fatal error messages
From: |
Andreas Schwab |
Subject: |
Re: Truncated fatal error messages |
Date: |
Sat, 22 Sep 2012 10:22:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
> This change:
>
> @@ -2012,7 +2014,12 @@ shut_down_emacs (int sig, Lisp_Object st
> {
> reset_all_sys_modes ();
> if (sig && sig != SIGTERM)
> - fprintf (stderr, "Fatal error %d: %s", sig, strsignal (sig));
> + {
> + char buf[100];
> + int buflen = snprintf (buf, sizeof buf, "Fatal error %d: %s",
> + sig, strsignal (sig));
> + ignore_value (write (STDERR_FILENO, buf, buflen));
> + }
> }
> }
> #else
>
> arbitrarily limits the signal description due to the 99-char limit of
> the buffer. Isn't it better to allocate the buffer (with alloca)
> based on the length of the signal description?
There is no need to copy the signal description in the buffer at all.
Andreas.
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."