From patchwork Mon Apr 15 09:36:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Singh Rawat X-Patchwork-Id: 16131 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A3E0920F46 for ; Mon, 15 Apr 2013 09:37:23 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id hf12sf6886629vcb.8 for ; Mon, 15 Apr 2013 02:36:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=TpzaQkGDqcIWNA3WpcHnSwc8hN0wG3f37RGy2J/bcLw=; b=gzcTDe5sq0BZ700ZqQpZipr2l/4ptlzBPVuvontazW98ULogXxaUmYWsjOhsNVs8b0 f3Nuq/rnLmslLdOPrq1x69P4CW5wr3ueeZ9oYZc3Sf3zyZ5WVysSiuXmDxzNfnsVKQmj XsrO8PVH4sIr2/G4ISnzsrU9+Ib1roSShbBXBJ+G/B+lPJp9lwt4PaIVx1qSyka2aWdw Tg1nYmovVDohoWHvw6pNwOGxcIhVtX0vHvmzM/qUX1nupVHtOEQCU8/Y9OGqD26V2f1t w10e+k3DCjTB32eaWUmKjBkCCS3tgFxd0FPK520wrzvBgQI+iiPM645LdYGlBTRAxlpz muWw== X-Received: by 10.224.109.129 with SMTP id j1mr327066qap.0.1366018613021; Mon, 15 Apr 2013 02:36:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.130.74 with SMTP id oc10ls468587qeb.53.gmail; Mon, 15 Apr 2013 02:36:52 -0700 (PDT) X-Received: by 10.52.101.129 with SMTP id fg1mr13093477vdb.112.1366018612867; Mon, 15 Apr 2013 02:36:52 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id p12si12715279vce.68.2013.04.15.02.36.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Apr 2013 02:36:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id 14so1493004vea.1 for ; Mon, 15 Apr 2013 02:36:52 -0700 (PDT) X-Received: by 10.220.175.3 with SMTP id v3mr5191210vcz.8.1366018612721; Mon, 15 Apr 2013 02:36:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp158190veb; Mon, 15 Apr 2013 02:36:52 -0700 (PDT) X-Received: by 10.68.176.197 with SMTP id ck5mr25755941pbc.165.1366018611401; Mon, 15 Apr 2013 02:36:51 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id tc4si18656426pbc.304.2013.04.15.02.36.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Apr 2013 02:36:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.173 is neither permitted nor denied by best guess record for domain of sanjay.rawat@linaro.org) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id v14so2430669pde.4 for ; Mon, 15 Apr 2013 02:36:50 -0700 (PDT) X-Received: by 10.68.116.133 with SMTP id jw5mr28154425pbb.9.1366018610763; Mon, 15 Apr 2013 02:36:50 -0700 (PDT) Received: from srawat-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPS id ba10sm19687421pbd.21.2013.04.15.02.36.46 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Apr 2013 02:36:49 -0700 (PDT) From: Sanjay Singh Rawat To: daniel.lezcano@linaro.org, linaro-dev@lists.linaro.org Cc: patches@linaro.org, Sanjay Singh Rawat Subject: [PATCH powerdebug] handle winch signal Date: Mon, 15 Apr 2013 15:06:50 +0530 Message-Id: <1366018610-17948-1-git-send-email-sanjay.rawat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlZTSziMo2O2iihR8hWNNccGec9veFhjA1Ga66q56VMtHUG2xREZYmH+QOXJmRFMEARKNex X-Original-Sender: sanjay.rawat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , - handle winch to display window properly - bug: https://bugs.launchpad.net/linaro-powerdebug/+bug/827828 Signed-off-by: Sanjay Singh Rawat --- display.c | 5 +++++ powerdebug.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/display.c b/display.c index 39a8e71..e9f4bf6 100644 --- a/display.c +++ b/display.c @@ -137,6 +137,11 @@ int display_refresh_pad(int win) 0, 2, 0, maxy - 2, maxx); } +void sigwinch_handler(int signo) +{ + display_refresh(current_win, true); +} + static int display_show_unselection(int win, int line, bool bold) { if (mvwchgat(windata[win].pad, line, 0, -1, diff --git a/powerdebug.c b/powerdebug.c index dd6ac04..4ee7f7d 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "regulator.h" #include "display.h" #include "clocks.h" @@ -28,6 +29,8 @@ #include "mainloop.h" #include "powerdebug.h" +extern void sigwinch_handler(int); + void usage(void) { printf("Usage: powerdebug [OPTIONS]\n"); @@ -207,6 +210,7 @@ static struct powerdebug_options *powerdebug_init(void) return NULL; memset(options, 0, sizeof(*options)); + signal(SIGWINCH, sigwinch_handler); return options; }