From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: Truncated fatal error messages Date: Sat, 22 Sep 2012 10:22:53 +0200 Message-ID: References: <83mx0iwkcn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1348302218 2567 80.91.229.3 (22 Sep 2012 08:23:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Sep 2012 08:23:38 +0000 (UTC) Cc: Paul Eggert , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 22 10:23:43 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TFL00-0003L9-Gu for ged-emacs-devel@m.gmane.org; Sat, 22 Sep 2012 10:23:40 +0200 Original-Received: from localhost ([::1]:40875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFKzv-0005WH-VD for ged-emacs-devel@m.gmane.org; Sat, 22 Sep 2012 04:23:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFKzp-0005V0-Gv for emacs-devel@gnu.org; Sat, 22 Sep 2012 04:23:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFKzl-0001bM-9f for emacs-devel@gnu.org; Sat, 22 Sep 2012 04:23:29 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]:33436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFKzP-0001WX-7h; Sat, 22 Sep 2012 04:23:03 -0400 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3XP4S01pFSz3hhZx; Sat, 22 Sep 2012 10:22:55 +0200 (CEST) X-Auth-Info: 98LOGp0e+aoKzzcMdRbcpm+9wjrq2/XzV4EetLMZqd8= Original-Received: from igel.home (ppp-93-104-152-244.dynamic.mnet-online.de [93.104.152.244]) by mail.mnet-online.de (Postfix) with ESMTPA id 3XP4Rz01TDzbbrW; Sat, 22 Sep 2012 10:22:54 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 501) id 60D1ACA2A2; Sat, 22 Sep 2012 10:22:53 +0200 (CEST) X-Yow: Okay, BARBRA STREISAND, I recognize you now!! Also EFREM ZIMBALIST, JUNIOR!! And BEAUMONT NEWHALL!! Everybody into th' BATHROOM! In-Reply-To: <83mx0iwkcn.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Sep 2012 11:08:24 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 212.18.0.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153454 Archived-At: Eli Zaretskii 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, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."