unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: Re: [RFC PATCH] configure: check for POSIX.1-2008 realpath(3) implementation.
Date: Sat, 25 Jan 2014 20:55:35 -0400	[thread overview]
Message-ID: <871tzvo92w.fsf@zancas.localnet> (raw)
In-Reply-To: <1390687142-16401-1-git-send-email-tomi.ollila@iki.fi>

Tomi Ollila <tomi.ollila@iki.fi> writes:
> +#if POSIX_2008_REALPATH
>      filename = realpath (config->filename, NULL);
> +#else
> +    /* compatibility with minor effort, not elegance, is the ruling factor
> +       in these (two) else branches... */
> +    char resolved_path[PATH_MAX];
> +    filename = realpath (config->filename, resolved_path);
> +#endif
>      if (! filename) {
>  	if (errno == ENOENT) {
> +#if POSIX_2008_REALPATH
>  	    filename = strdup (config->filename);
> +#else
> +	    /* ... this is the other else... */
> +	    resolved_path[sizeof resolved_path - 1] = '\0';
> +	    strncpy(resolved_path, config->filename, sizeof resolved_path);
> +	    /* "faking" out of memory in case path too long -- close enough? */
> +	    filename = resolved_path[sizeof resolved_path - 1]?
> +		resolved_path: NULL;
> +#endif

I worry a bit about making the mainline code messier and harder to maintain, in order to
accomodate an unknown number of targets without POSIX2008 realpath. Do
we know how widespread this problem is? Is it just NetBSD?

I looked at borrowing realpath from gnulib; it looks like it would be a
bit of work as the least complicated version includes 3 other include
files. But then the mainline code could be blisfully ignorant of the
whole dispute.

d

  parent reply	other threads:[~2014-01-26  0:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-25 21:59 [RFC PATCH] configure: check for POSIX.1-2008 realpath(3) implementation Tomi Ollila
2014-01-25 22:22 ` Tomi Ollila
2014-01-26  0:55 ` David Bremner [this message]
2014-01-26 11:18   ` Tomi Ollila
2014-01-26 16:49     ` David Bremner
2014-01-27 14:12       ` [PATCH] compat: add canonicalize_file_name David Bremner
2014-01-27 19:07         ` Tomi Ollila
2014-04-08 11:22         ` David Bremner
2014-04-09 11:24           ` [PATCH 1/2] build: add canonicalize_file_name to symbols exported from libnotmuch.so David Bremner
2014-04-09 11:24             ` [PATCH 2/2] configure: fix comment, pass HAVE_CANONICALIZE_FILE_NAME to build David Bremner
2014-04-17 22:24               ` [PATCH] " David Bremner
2014-04-14 12:21             ` [PATCH 1/2] build: add canonicalize_file_name to symbols exported from libnotmuch.so Tomi Ollila
2014-04-18 21:05             ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871tzvo92w.fsf@zancas.localnet \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).