From patchwork Mon Aug 6 15:19:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 1280261 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8FBD9DF288 for ; Mon, 6 Aug 2012 15:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755531Ab2HFP1l (ORCPT ); Mon, 6 Aug 2012 11:27:41 -0400 Received: from alice.et.bocholt.fh-gelsenkirchen.de ([193.175.197.63]:41324 "EHLO alice.et.bocholt.fh-gelsenkirchen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755529Ab2HFP1k (ORCPT ); Mon, 6 Aug 2012 11:27:40 -0400 X-Greylist: delayed 470 seconds by postgrey-1.27 at vger.kernel.org; Mon, 06 Aug 2012 11:27:40 EDT Received: from musashi.et.bocholt.fh-gelsenkirchen.de (musashi.hank.lab [192.168.106.100]) by alice.et.bocholt.fh-gelsenkirchen.de (8.14.3/8.14.3) with ESMTP id q76FJjmr024447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Aug 2012 17:19:45 +0200 X-DKIM: Sendmail DKIM Filter v2.8.3 alice.et.bocholt.fh-gelsenkirchen.de q76FJjmr024447 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=et.bocholt.fh-gelsenkirchen.de; s=et; t=1344266385; bh=nBR+enDhNRZ0mNwA8J8ZyI0U9iJ0tQ4OHpzjoV0tWHk=; h=From:Subject:Date:Message-ID:MIME-Version:Content-Type; b=rBjreLLlrF63DeYSrifU9Ce1L0T5RhWJlgWbV1gPmG/EPh1pFFyMdHjxVB+ZAP163 tFYKOiHoKBlaY4YxgypF0NdThXNCc/1HYGCtkyxUpUC96YKZKQbXz6ClrmPQgwunuz J4Vs5b7rl+QQnqp8s3BNcZ6IRCNztn0ebdjFTGe4= Received: from localhost ([10.8.0.6]) by musashi.et.bocholt.fh-gelsenkirchen.de (8.14.5/8.14.2) with ESMTP id q76FJiXU053029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Aug 2012 17:19:44 +0200 (CEST) (envelope-from gouders@et.bocholt.fh-gelsenkirchen.de) From: Dirk Gouders To: Michal Marek , Arnaud Lacombe Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [RFC] kconfig/mconf.c: revision of curses initialization. User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Date: Mon, 06 Aug 2012 17:19:43 +0200 Message-ID: MIME-Version: 1.0 X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (alice.et.bocholt.fh-gelsenkirchen.de [192.168.0.63]); Mon, 06 Aug 2012 17:19:45 +0200 (CEST) X-Spam-Status: No, score=-6.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VERIFIED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on merlin.ccamp.de Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Hello, I noticed that in mconf, initscr() is called twice -- as far as I found out since commit d0e1e09568. In case you see a need to fix that: I first thought about simply removing the call in init_dialog() in util.c but then had the feeling that saving of initial cursor positions also perhaps is better done in that function... Dirk ------------------------------------------------------------------------ From 1a4022eedbee6032dea16f67bbe4028a8d3d07a0 Mon Sep 17 00:00:00 2001 From: Dirk Gouders Date: Mon, 6 Aug 2012 16:48:23 +0200 Subject: [PATCH] kconfig/mconf.c: revision of curses initialization. Since commit d0e1e09568 initscr() is called twice in mconf. Do it only in init_dialog() in util.c and there also save the cursor position for the signal handler in mconf.c. Signed-off-by: Dirk Gouders --- scripts/kconfig/lxdialog/dialog.h | 1 + scripts/kconfig/lxdialog/util.c | 7 +++++++ scripts/kconfig/mconf.c | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h index b5211fc..43a58ec 100644 --- a/scripts/kconfig/lxdialog/dialog.h +++ b/scripts/kconfig/lxdialog/dialog.h @@ -144,6 +144,7 @@ struct dialog_info { */ extern struct dialog_info dlg; extern char dialog_input_result[]; +extern int saved_x, saved_y; /* Needed in signal handler in mconf.c */ /* * Function prototypes diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c index f2375ad..109d531 100644 --- a/scripts/kconfig/lxdialog/util.c +++ b/scripts/kconfig/lxdialog/util.c @@ -23,6 +23,9 @@ #include "dialog.h" +/* Needed in signal handler in mconf.c */ +int saved_x, saved_y; + struct dialog_info dlg; static void set_mono_theme(void) @@ -273,6 +276,10 @@ int init_dialog(const char *backtitle) int height, width; initscr(); /* Init curses */ + + /* Get current cursor position for signal handler in mconf.c */ + getyx(stdscr, saved_y, saved_x); + getmaxyx(stdscr, height, width); if (height < 19 || width < 80) { endwin(); diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index f584a28..d856d40 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -273,7 +273,6 @@ static struct menu *current_menu; static int child_count; static int single_menu_mode; static int show_all_options; -static int saved_x, saved_y; static void conf(struct menu *menu); static void conf_choice(struct menu *menu); @@ -862,9 +861,6 @@ int main(int ac, char **av) single_menu_mode = 1; } - initscr(); - - getyx(stdscr, saved_y, saved_x); if (init_dialog(NULL)) { fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));