From 00709ae3b089d7f0223b98c48cae0fe10e95b90b Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Mon, 27 Jan 2014 21:07:03 +0200 Subject: [PATCH] Re: [PATCH] compat: add canonicalize_file_name --- 2d/a5593028e53611fefb4f8d241fb725bf07b9d7 | 83 +++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 2d/a5593028e53611fefb4f8d241fb725bf07b9d7 diff --git a/2d/a5593028e53611fefb4f8d241fb725bf07b9d7 b/2d/a5593028e53611fefb4f8d241fb725bf07b9d7 new file mode 100644 index 000000000..28dcefc76 --- /dev/null +++ b/2d/a5593028e53611fefb4f8d241fb725bf07b9d7 @@ -0,0 +1,83 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id E1DDC431FBD + for ; Mon, 27 Jan 2014 11:07:16 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id aCWuVDpFgUEV for ; + Mon, 27 Jan 2014 11:07:09 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 9858E431FBC + for ; Mon, 27 Jan 2014 11:07:09 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 9ABF1100051; + Mon, 27 Jan 2014 21:07:03 +0200 (EET) +From: Tomi Ollila +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [PATCH] compat: add canonicalize_file_name +In-Reply-To: <1390831932-7865-1-git-send-email-david@tethera.net> +References: <8761p6n0wc.fsf@zancas.localnet> + <1390831932-7865-1-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.17+55~g4397960 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 27 Jan 2014 19:07:17 -0000 + +On Mon, Jan 27 2014, David Bremner wrote: + +> the POSIX 2008 behaviour of realpath is not available everywhere so we +> provide a simple wrapper function. We use (and provide) the gnu +> extension canonicalize_file_name to make it cleaner to test for the +> feature we need; otherwise we have to rely on realpath segfaulting if +> the second argument is null. +> --- + +I think this patch is tolerable. I first thought we should check the +combination of not having canonicalize_file_name() and having POSIX 2008 +behaviour of realpath()... + +... but the compat code is simple enough and basically done the same way +as in (e.g.) + +http://svnweb.freebsd.org/base/release/9.2.0/lib/libc/stdlib/realpath.c?revision=255898&view=markup + +qualifying the implementation. So +1 from me. + +Tomi + +> compat/Makefile.local | 4 ++++ +> compat/canonicalize_file_name.c | 18 ++++++++++++++++++ +> compat/compat.h | 8 ++++++++ +> compat/have_canonicalize_file_name.c | 10 ++++++++++ +> configure | 16 ++++++++++++++++ +> notmuch-config.c | 2 +- +> 6 files changed, 57 insertions(+), 1 deletion(-) +> create mode 100644 compat/canonicalize_file_name.c +> create mode 100644 compat/have_canonicalize_file_name.c +> -- 2.26.2