Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / 4c / 1094a1fce8518c3f390bbd3986dd6b2e151e63
1 Return-Path: <chris@chris-wilson.co.uk>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 2779A431FC3\r
6         for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:44:43 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id w4A-n-S20vtV for <notmuch@notmuchmail.org>;\r
11         Sat, 21 Nov 2009 16:44:42 -0800 (PST)\r
12 Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21])\r
13         by olra.theworths.org (Postfix) with ESMTP id A813C431FC4\r
14         for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 16:44:40 -0800 (PST)\r
15 Received: from orsmga002.jf.intel.com ([10.7.209.21])\r
16         by orsmga101.jf.intel.com with ESMTP; 21 Nov 2009 16:44:32 -0800\r
17 X-ExtLoop1: 1\r
18 X-IronPort-AV: E=Sophos;i="4.47,265,1257148800"; d="scan'208";a="469444045"\r
19 Received: from unknown (HELO localhost.localdomain) ([10.255.16.190])\r
20         by orsmga002.jf.intel.com with ESMTP; 21 Nov 2009 17:01:42 -0800\r
21 From: Chris Wilson <chris@chris-wilson.co.uk>\r
22 To: notmuch@notmuchmail.org\r
23 Date: Sun, 22 Nov 2009 00:44:32 +0000\r
24 Message-Id: <1258850672-28339-3-git-send-email-chris@chris-wilson.co.uk>\r
25 X-Mailer: git-send-email 1.6.5.3\r
26 In-Reply-To: <1258850672-28339-1-git-send-email-chris@chris-wilson.co.uk>\r
27 References: <1258850672-28339-1-git-send-email-chris@chris-wilson.co.uk>\r
28 Subject: [notmuch] [PATCH 2/2] notmuch-new: Only print the regular progress\r
29         report when on a tty\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.12\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Sun, 22 Nov 2009 00:44:43 -0000\r
43 \r
44 Check that the stdout is connected to an interactive terminal with\r
45 isatty() before installing the periodic timer to print progress reports.\r
46 \r
47 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>\r
48 ---\r
49  notmuch-new.c |    4 +++-\r
50  1 files changed, 3 insertions(+), 1 deletions(-)\r
51 \r
52 diff --git a/notmuch-new.c b/notmuch-new.c\r
53 index 1616ee9..0dd2784 100644\r
54 --- a/notmuch-new.c\r
55 +++ b/notmuch-new.c\r
56 @@ -20,6 +20,8 @@\r
57  \r
58  #include "notmuch-client.h"\r
59  \r
60 +#include <unistd.h>\r
61 +\r
62  static volatile sig_atomic_t do_add_files_print_progress = 0;\r
63  \r
64  static void\r
65 @@ -273,7 +275,7 @@ add_files (notmuch_database_t *notmuch,\r
66      }\r
67  \r
68      /* Setup our handler for SIGALRM */\r
69 -    if (! debugger_is_active ()) {\r
70 +    if (isatty (fileno (stdout)) && ! debugger_is_active ()) {\r
71         memset (&action, 0, sizeof (struct sigaction));\r
72         action.sa_handler = handle_sigalrm;\r
73         sigemptyset (&action.sa_mask);\r
74 -- \r
75 1.6.5.3\r
76 \r