Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)
authorBlake Jones <blakej@foo.net>
Mon, 5 Nov 2012 04:50:59 +0000 (20:50 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:19 +0000 (09:50 -0800)
c3/d761836e90061255f58247f0de3d3bcf70d159 [new file with mode: 0644]

diff --git a/c3/d761836e90061255f58247f0de3d3bcf70d159 b/c3/d761836e90061255f58247f0de3d3bcf70d159
new file mode 100644 (file)
index 0000000..d447423
--- /dev/null
@@ -0,0 +1,76 @@
+Return-Path: <blakej@foo.net>\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 38906431FAF\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Nov 2012 20:51:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 xqrONA2I1i6P for <notmuch@notmuchmail.org>;\r
+       Sun,  4 Nov 2012 20:51:02 -0800 (PST)\r
+Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 43D7D431FAE\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Nov 2012 20:51:02 -0800 (PST)\r
+Received: from foo.net (localhost [127.0.0.1])\r
+       by foo.net (8.14.5+Sun/8.14.5) with ESMTP id qA54oxOX004595;\r
+       Sun, 4 Nov 2012 20:50:59 -0800 (PST)\r
+To: Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH 10/10] timegm: add portable implementation (Solaris\r
+       support) \r
+In-Reply-To: Your message of "Sun, 04 Nov 2012 22:58:26 +0200."\r
+       <87ip9lf5l9.fsf@nikula.org> \r
+Date: Sun, 04 Nov 2012 20:50:59 -0800\r
+Message-ID: <4594.1352091059@foo.net>\r
+From: Blake Jones <blakej@foo.net>\r
+X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2\r
+       (foo.net [127.0.0.1]); Sun, 04 Nov 2012 20:50:59 -0800 (PST)\r
+Cc: notmuch@notmuchmail.org\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: Mon, 05 Nov 2012 04:51:06 -0000\r
+\r
+> That is a valid point. Yet it doesn't change the fact that I'd prefer\r
+> to use timegm() where available. Internally, glibc uses the same code\r
+> to implement both timegm() and mktime(), and I'd hate it if the\r
+> results were subtly different depending on whether the time zone was\r
+> specified in the input or not.\r
+\r
+That's fine with me.\r
+\r
+> That said, I'm not opposed to using your simple timegm() alternative\r
+> in the compat code if you think it's good enough to get you going on\r
+> Solaris.\r
+\r
+I think it is, assuming you don't plan to use tm_wday or tm_yday in your\r
+parse-time-string code, and that you don't plan to depend on the side\r
+effect of timegm() canonicalizing the passed-in "struct tm".\r
+\r
+> As to solving the compat linking problem, I think the patch at the end\r
+> of this message should fix it. Please try that with the regular\r
+> notmuch approach to portability. The general idea is to keep\r
+> parse-time-string as independent as possible from the rest of notmuch\r
+> (possibly turning it into a dynamic library and a package of its own\r
+> eventually), but I think including compat.h is an acceptable exception\r
+> to make.\r
+\r
+Yeah, this seems to work.  I'll update my patch set accordingly.\r
+\r
+Blake\r