[PATCH v3 3/4] new: Print final fatal error message to stderr
authorAustin Clements <amdragon@MIT.EDU>
Sun, 22 Apr 2012 15:50:51 +0000 (11:50 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:38 +0000 (09:46 -0800)
3e/4ece23a323fe08ce12b07737d38b3648fa5ede [new file with mode: 0644]

diff --git a/3e/4ece23a323fe08ce12b07737d38b3648fa5ede b/3e/4ece23a323fe08ce12b07737d38b3648fa5ede
new file mode 100644 (file)
index 0000000..7925cda
--- /dev/null
@@ -0,0 +1,99 @@
+Return-Path: <amthrax@drake.mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 616AA431FBF\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 08:51:00 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id fEsTfXtWZJQK for <notmuch@notmuchmail.org>;\r
+       Sun, 22 Apr 2012 08:50:59 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
+       [18.9.25.12])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3BD18431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 08:50:59 -0700 (PDT)\r
+X-AuditID: 1209190c-b7fad6d000000920-e0-4f9428e2c75b\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 14.1F.02336.2E8249F4; Sun, 22 Apr 2012 11:50:58 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q3MFovlQ009854; \r
+       Sun, 22 Apr 2012 11:50:57 -0400\r
+Received: from drake.mit.edu\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3MFou5m003694\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 22 Apr 2012 11:50:57 -0400 (EDT)\r
+Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amthrax@drake.mit.edu>)\r
+       id 1SLz3w-0002fG-KB; Sun, 22 Apr 2012 11:50:56 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 3/4] new: Print final fatal error message to stderr\r
+Date: Sun, 22 Apr 2012 11:50:51 -0400\r
+Message-Id: <1335109852-10150-4-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1335109852-10150-1-git-send-email-amdragon@mit.edu>\r
+References: <1330357759-1337-1-git-send-email-amdragon@mit.edu>\r
+       <1335109852-10150-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixCmqrPtIY4q/wa0dehbXb85kdmD0eLbq\r
+       FnMAYxSXTUpqTmZZapG+XQJXxt/1d9gK1rBVLNiyk62BsZ21i5GTQ0LARKLjzRwmCFtM4sK9\r
+       9WxdjFwcQgL7GCU6Hv9nhXA2MErsmv2bEcK5zyTx5cQrFghnPqPEyzu/wPrZBDQktu1fzghi\r
+       iwhIS+y8OxuonYODWUBN4k+XCkhYWMBN4tjLu8wgNouAqsTpC7dYQGxeAQeJv3MPQZ2hIPFs\r
+       3XEwm1PAUeLju5VgtpBAmcS3eW/ZJzDyL2BkWMUom5JbpZubmJlTnJqsW5ycmJeXWqRrqJeb\r
+       WaKXmlK6iREcNpI8OxjfHFQ6xCjAwajEw/vKZLK/EGtiWXFl7iFGSQ4mJVFeN7Up/kJ8Sfkp\r
+       lRmJxRnxRaU5qcWHGCU4mJVEeD+LAJXzpiRWVqUW5cOkpDlYlMR5VbTe+QkJpCeWpGanphak\r
+       FsFkZTg4lCR4zYHxISRYlJqeWpGWmVOCkGbi4AQZzgM03Bqkhre4IDG3ODMdIn+KUVFKnFcZ\r
+       JCEAksgozYPrhcX1K0ZxoFeEecVBqniAKQGu+xXQYCagwQkxk0AGlyQipKQaGPN3XPPMk7DY\r
+       o2xZx3mkltfi675yq4zLGjcmM61UEK69cZnt38f4ijXVRo7FgT+kCvN3LttnceOjh0uBfoWo\r
+       ZlpJg+YTzkPeF86emr3uWnzqJ8uoZx/ZLqtc/3LzASvXTcYIMd0NZUvK6wJOnpxxetfaLUqL\r
+       Xh0UP1zMd0fA0U2NJfmEpqnNQSWW4oxEQy3mouJEALGoeQzGAgAA\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 22 Apr 2012 15:51:00 -0000\r
+\r
+This was going to stdout.  I removed the newline at the beginning of\r
+printing the fatal error message because it wouldn't make sense if you\r
+were only looking at the stderr stream (e.g., you had redirected\r
+stdout to /dev/null).\r
+---\r
+ notmuch-new.c |    4 ++--\r
+ 1 files changed, 2 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/notmuch-new.c b/notmuch-new.c\r
+index 2faf2f8..bf9b120 100644\r
+--- a/notmuch-new.c\r
++++ b/notmuch-new.c\r
+@@ -1035,8 +1035,8 @@ notmuch_new_command (void *ctx, int argc, char *argv[])\r
+     printf ("\n");\r
+ \r
+     if (ret)\r
+-      printf ("\nNote: A fatal error was encountered: %s\n",\r
+-              notmuch_status_to_string (ret));\r
++      fprintf (stderr, "Note: A fatal error was encountered: %s\n",\r
++               notmuch_status_to_string (ret));\r
+ \r
+     notmuch_database_close (notmuch);\r
+ \r
+-- \r
+1.7.9.1\r
+\r