From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Maciej Marcin Piechotka Newsgroups: gmane.emacs.bugs Subject: bug#10631: Update of patch Date: Sat, 28 Jan 2012 18:46:51 +0000 Message-ID: <1327776411.1921.25.camel@localhost.localdomain> References: <1327767888.1934.14.camel@localhost.localdomain> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-UKvF7VdHnN4eP9JGBVcO" X-Trace: dough.gmane.org 1327776513 20626 80.91.229.3 (28 Jan 2012 18:48:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 Jan 2012 18:48:33 +0000 (UTC) To: 10631@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 28 19:48:32 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RrDK6-0000t5-Oy for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Jan 2012 19:48:27 +0100 Original-Received: from localhost ([::1]:41658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrDK6-0007fr-Bc for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Jan 2012 13:48:26 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:41089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrDK1-0007ed-IL for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 13:48:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrDJy-0001RF-KA for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 13:48:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrDJy-0001Qx-Hg for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 13:48:18 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RrDKg-0001th-GD for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 13:49:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <1327767888.1934.14.camel@localhost.localdomain> Resent-From: Maciej Marcin Piechotka Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Jan 2012 18:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10631 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10631-submit@debbugs.gnu.org id=B10631.13277765007243 (code B ref 10631); Sat, 28 Jan 2012 18:49:02 +0000 Original-Received: (at 10631) by debbugs.gnu.org; 28 Jan 2012 18:48:20 +0000 Original-Received: from localhost ([127.0.0.1]:48504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrDJz-0001sm-J9 for submit@debbugs.gnu.org; Sat, 28 Jan 2012 13:48:19 -0500 Original-Received: from mail-wi0-f172.google.com ([209.85.212.172]:40255) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrDJx-0001sY-SS for 10631@debbugs.gnu.org; Sat, 28 Jan 2012 13:48:18 -0500 Original-Received: by wicr5 with SMTP id r5so2152519wic.3 for <10631@debbugs.gnu.org>; Sat, 28 Jan 2012 10:47:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:subject:from:to:date:content-type:x-mailer:mime-version; bh=Mvi1+h63bUMR5y5sgbrwiWLcJUMLvKnW2UNnal5V49s=; b=NlpCs2mt2wsaMLIPLKHdQfeU94XX1hGzRkqh0MraALolwp7H4VjLucFz7gJEcooOZa oWlNvxLTt9lAhu1uRFbMXoKCd7B6IBPyBzw3zYpyPkLVaru+kTWmUW8rOz1EyR3JYoxj BGELjEqb+/3NEDkbdepINfFBIWBMUr6FBpeIc= Original-Received: by 10.180.93.132 with SMTP id cu4mr18935759wib.9.1327776447522; Sat, 28 Jan 2012 10:47:27 -0800 (PST) Original-Received: from [192.168.23.104] (client-86-29-155-99.glfd-bam-2.adsl.virginmedia.com. [86.29.155.99]) by mx.google.com with ESMTPS id j16sm35241392wie.4.2012.01.28.10.47.26 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 Jan 2012 10:47:26 -0800 (PST) X-Mailer: Evolution 3.2.3 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:56137 Archived-At: --=-UKvF7VdHnN4eP9JGBVcO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Ups. Sorry - I forgot to add one file to git index. Corrected patch attached. --=-UKvF7VdHnN4eP9JGBVcO Content-Disposition: attachment; filename*0=0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.pat; filename*1=ch Content-Type: text/x-patch; name="0001-Fix-infinit-loop-when-emacs-is-compiled-with-GTK-sup.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit >From 3a06fc2b48eb7e55834d8e5e4adda1f2286758db Mon Sep 17 00:00:00 2001 From: Maciej Piechotka Date: Sat, 28 Jan 2012 16:12:45 +0000 Subject: [PATCH] Fix infinit loop when emacs is compiled with GTK+ support and used in no-window mode --- src/xgselect.c | 17 +++++------------ src/xgselect.h | 2 -- src/xterm.c | 2 -- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/xgselect.c b/src/xgselect.c index 333f7b1..4301eee 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -55,9 +55,11 @@ xg_select (max_fds, rfds, wfds, efds, timeout) do { if (n_gfds > gfds_size) { - while (n_gfds > gfds_size) - gfds_size *= 2; - xfree (gfds); + gfds_size = 1 << g_bit_storage (n_gfds); + if (gfds) + { + xfree (gfds); + } gfds = xmalloc (sizeof (*gfds) * gfds_size); } @@ -152,14 +154,5 @@ xg_select (max_fds, rfds, wfds, efds, timeout) } #endif /* defined (USE_GTK) || defined (HAVE_GCONF) */ -void -xgselect_initialize () -{ -#if defined (USE_GTK) || defined (HAVE_GCONF) - gfds_size = 128; - gfds = xmalloc (sizeof (*gfds)*gfds_size); -#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */ -} - /* arch-tag: c5873ee3-d1f6-44f9-9f3b-b14f70fd0e6a (do not change this comment) */ diff --git a/src/xgselect.h b/src/xgselect.h index 14488d6..3bb5428 100644 --- a/src/xgselect.h +++ b/src/xgselect.h @@ -30,8 +30,6 @@ extern int xg_select P_ ((int max_fds, SELECT_TYPE *efds, EMACS_TIME *timeout)); -extern void xgselect_initialize P_ ((void)); - #endif /* XGSELECT_H */ /* arch-tag: 0c5392a8-3a41-41eb-839c-58e6595926f0 diff --git a/src/xterm.c b/src/xterm.c index af8af50..83412ae 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10989,8 +10989,6 @@ x_initialize () XSetIOErrorHandler (x_io_error_quitter); signal (SIGPIPE, x_connection_signal); - - xgselect_initialize (); } -- 1.7.8.4 --=-UKvF7VdHnN4eP9JGBVcO--